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

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

GitHub user viachka opened a pull request:

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

    CAMEL-12511: Init scheduledExecutorService before ConsulEventConsumer's 
watcher run

    

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

    $ git pull https://github.com/viachka/camel 
camel-12511-npe-on-consuleventconsumer-start

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

    https://github.com/apache/camel/pull/2342.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 #2342
    
----
commit 851f6208fc208427f02a44adc4bce1f0e6d0ff34
Author: Viachaslau Tsikhanovich <viachaslau_tsikhanovich@...>
Date:   2018-05-15T12:07:54Z

    CAMEL-12511: Init scheduledExecutorService before ConsulEventConsumer's 
watcher run

----


> camel-consul - NPE on ConsulEventConsumer start
> -----------------------------------------------
>
>                 Key: CAMEL-12511
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12511
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-consul
>    Affects Versions: 2.21.1
>            Reporter: Viachaslau Tsikhanovich
>            Priority: Major
>             Fix For: 2.21.2, 2.22.0
>
>
> When _doStart_ is called on ConsulEventConsumer it first 
> [calls|https://github.com/apache/camel/blob/camel-2.21.1/components/camel-consul/src/main/java/org/apache/camel/component/consul/endpoint/ConsulEventConsumer.java#L54]
>  _doStart_ of a superclass _AbstractConsulConsumer_ when 
> _scheduledExecutorService_ is not initialized yet.
> EventWatcher run [is 
> allowed|https://github.com/apache/camel/blob/camel-2.21.1/components/camel-consul/src/main/java/org/apache/camel/component/consul/endpoint/AbstractConsulConsumer.java#L95].
>  Thus _EventWatcher.watch_ is called with uninitialized 
> _scheduledExecutorService_ and failing with NPE.
> {quote}
>  Caused by: java.lang.NullPointerException: null
>          at 
> org.apache.camel.component.consul.endpoint.ConsulEventConsumer$EventWatcher.watch(ConsulEventConsumer.java:76)
>          at 
> org.apache.camel.component.consul.endpoint.ConsulEventConsumer$EventWatcher.watch(ConsulEventConsumer.java:68)
>          at 
> org.apache.camel.component.consul.endpoint.AbstractConsulConsumer$AbstractWatcher.run(AbstractConsulConsumer.java:96)
>          at 
> org.apache.camel.component.consul.endpoint.AbstractConsulConsumer.doStart(AbstractConsulConsumer.java:56)
>          at 
> org.apache.camel.component.consul.endpoint.ConsulEventConsumer.doStart(ConsulEventConsumer.java:54)
>          at 
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
>          at 
> org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3705)
>          at 
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:4023)
>          at 
> org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:3958)
>          at 
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3878)
>          at 
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3642)
>          at 
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3494)
>          at 
> org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:209)
>          at 
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3253)
>          at 
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3249)
>          at 
> org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3272)
>          at 
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3249)
>          at 
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
>          at 
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3165)
>          at 
> org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:133)
>                ...
> {quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to