Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12511

camel-consul - NPE on ConsulEventConsumer start

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.21.1
    • Fix Version/s: 2.21.2, 2.22.0
    • Component/s: camel-consul
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      When doStart is called on ConsulEventConsumer it first calls doStart of a superclass AbstractConsulConsumer when scheduledExecutorService is not initialized yet.

      EventWatcher run is allowed. Thus EventWatcher.watch is called with uninitialized scheduledExecutorService and failing with NPE.

      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)
      ...

        Attachments

          Activity

            People

            • Assignee:
              lb Luca Burgazzoli
              Reporter:
              Viachaslau.Tsikhanovich Viachaslau Tsikhanovich
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: