Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
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.