Uploaded image for project: 'ServiceMix Components'
  1. ServiceMix Components
  2. SMXCOMP-945

OsgiJbiComponent should use camel ServiceSupport to manage the lifecycle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2011.02.2, 2013.01
    • servicemix-camel
    • None

    Description

      currently it implements spring InitializingBean/DisposableBean to do init/cleanup, so that with blueprint configuration will get exception like
      Caused by: java.lang.NullPointerException
      at org.apache.servicemix.camel.JbiEndpoint$JbiProducer.start(JbiEndpoint.java:94)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:56)
      at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:378)
      ... 82 more

      it's because
      org.apache.servicemix.camel.osgi.OsgiJbiComponent.afterPropertiesSet() method
      was called when using Spring so the camelJbiComponent was set to a non-null value. When using blueprint, this method was never called therefore the camelJbiComponent was always null and it caused NPE in JbiEndpoint$JbiProducer.start() function later on since jbiComponent.getCamelJbiComponent() return a null value:

      We should leverage Camel ServiceSupport start|stop method to take care of the lifecycle to make it IOC container independent.

      Attachments

        Activity

          People

            ffang Freeman Yue Fang
            ffang Freeman Yue Fang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: