I tried removing camelTemplate from spring configuration and creating camel
Producer template from camel context in my POJO. Here is what i got 

2012-02-08 17:26:01,144 DEBUG
[org.apache.camel.processor.DefaultErrorHandler.debug(72)] - <Failed
delivery for exchangeId: ID-msidd-3710-1328739667175-0-17. On delivery
attempt: 0 caught: org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.BeanCreationNotAllowedException: Error
creating bean with name 'camel': Singleton bean creation not allowed while
the singletons of this factory are in destruction (Do not request a bean
from a BeanFactory in a destroy method implementation!)>


It looks like spring has no way to find that camel Context is the bean that
should be destroyed first.
I looked into code of SpringCamelContext and it doesn't implement
SmartLifecycle interface from spring. If it does , we will probably have a
way to tell spring its creation and destruction order.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Spring-destroys-camelTemplate-before-CamelContext-tp5464452p5468029.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to