[ 
https://issues.apache.org/jira/browse/CAMEL-11214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16064509#comment-16064509
 ] 

ASF GitHub Bot commented on CAMEL-11214:
----------------------------------------

GitHub user vrlgohel opened a pull request:

    https://github.com/apache/camel/pull/1789

    [CAMEL-11214] Restrict FluentProducerTemplate to include a dummy URI

    Fix for CAMEL-11214

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vrlgohel/camel-1 master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1789.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1789
    
----
commit 5697890857a7b13592c00f07ac053f0d4dcc6926
Author: Viral Gohel <[email protected]>
Date:   2017-06-27T09:03:14Z

    [CAMEL-11214] Restrict FluentProducerTemplate to include a dummy URI

----


> FluentProducerTemplate - Should allow non default uri
> -----------------------------------------------------
>
>                 Key: CAMEL-11214
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11214
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.19.0
>            Reporter: Claus Ibsen
>             Fix For: 2.20.0
>
>         Attachments: 
> 0001-Fix-CAMEL-11214-FluentProducerTemplate-Should-allow-.patch
>
>
> You get
> Caused by: org.apache.camel.spring.GenericBeansException: Error post 
> processing bean: geoRestController; nested exception is 
> java.lang.NullPointerException
>       at 
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:159)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
>       ... 21 more
> Caused by: java.lang.NullPointerException
>       at java.util.Objects.requireNonNull(Objects.java:203)
>       at java.util.Optional.<init>(Optional.java:96)
>       at java.util.Optional.of(Optional.java:108)
>       at 
> org.apache.camel.builder.DefaultFluentProducerTemplate.setDefaultEndpoint(DefaultFluentProducerTemplate.java:103)
>       at 
> org.apache.camel.impl.CamelPostProcessorHelper.createInjectionFluentProducerTemplate(CamelPostProcessorHelper.java:333)
>       at 
> org.apache.camel.impl.CamelPostProcessorHelper.getInjectionValue(CamelPostProcessorHelper.java:224)
>       at 
> org.apache.camel.impl.DefaultCamelBeanPostProcessor.injectField(DefaultCamelBeanPostProcessor.java:200)
>       at 
> org.apache.camel.impl.DefaultCamelBeanPostProcessor.injectField(DefaultCamelBeanPostProcessor.java:194)
>       at 
> org.apache.camel.impl.DefaultCamelBeanPostProcessor$1.doWith(DefaultCamelBeanPostProcessor.java:181)
>       at 
> org.apache.camel.util.ReflectionHelper.doWithFields(ReflectionHelper.java:73)
>       at 
> org.apache.camel.impl.DefaultCamelBeanPostProcessor.injectFields(DefaultCamelBeanPostProcessor.java:167)
>       at 
> org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:82)
>       at 
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:153)
>       ... 24 more
> If you just have
>     @EndpointInject
>     private FluentProducerTemplate template;
> So you need to set some dummy uri
>     @EndpointInject(uri = "log:foo")
>     private FluentProducerTemplate template;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to