Hello,
it seems, that the order of defining beans in spring matters. With the following configuration, when the bundle is being stopped, I got exception:
Could not unregister error handler: org.apache.camel.management.mbean.ManagedErrorHandler@427a0b as ErrorHandler MBean.
org.apache.camel.NoSuchBeanException: Cannot lookup: testErrorHandler from registry: org.apache.camel.spring.spi.ApplicationContextRegistry@b1e15c with expec- 2.9.
ted type: interface org.apache.camel.builder.ErrorHandlerBuilder due: Error creating bean with name 'testErrorHandler': Singleton bean creation not allowed w
hile the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
Spring context:
<camel-osgi:camelContext id="test-context" xmlns="http://camel.apache.org/schema/spring">
<route id="test-route" errorHandlerRef="testErrorHandler">
<from uri="jetty:http://0.0.0.0/test" />
<to uri="log:TEST?showAll=true" />
</route>
</camel-osgi:camelContext>
<bean id="testErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="deadLetterUri" value="mock:dead" />
</bean>
But if I define testErrorHandler bean before camel context, bundle is stopped without any exceptions:
<bean id="testErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="deadLetterUri" value="mock:dead" />
</bean>
<camel-osgi:camelContext id="test-context" xmlns="http://camel.apache.org/schema/spring">
<route id="test-route" errorHandlerRef="testErrorHandler">
<from uri="jetty:http://0.0.0.0/test" />
<to uri="log:TEST?showAll=true" />
</route>
</camel-osgi:camelContext>
Is it a bug? There were no issues with previous version (apache-servicemix-4.3.1-fuse).
Tested with fuse-esb-7.0.0.fuse-061