Hi Claus,

I ran into a similar issue as Pascal did.  I followed your suggestion and
added 

depends-on="myCamel" 

to my Spring <bean>.  But then I got the following error when I terminated
Camel (Ctrl-c).  It looks like, instead of complaining about my bean, Spring
is now complaining about "myCamel".  Any suggestion?  I am using 2.12.1.

org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.BeanCreationNotAllowedException: Error
creating bean with
 name 'myCamel': 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!)
        at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1344)
        at
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByName(PropertyPlaceholderDelegateRegistry.java:52)
        at
org.apache.camel.component.bean.RegistryBean.lookupBean(RegistryBean.java:155)
        at
org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:65)
        at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:77)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)
        at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:67)
        at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:103)
        at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71)
        at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelpe
r.java:61)
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110)
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
        at
org.apache.camel.processor.interceptor.HandleFaultInterceptor.process(HandleFaultInterceptor.java:41)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)
        at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
        at
org.apache.camel.processor.FatalFallbackErrorHandler.process(FatalFallbackErrorHandler.java:42)
        at
org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:839)
        at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:337)
        at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
        at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
        at
org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:43)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)
        at
org.apache.camel.processor.loadbalancer.LoadBalancerSupport.process(LoadBalancerSupport.java:82)
        at
org.apache.camel.component.quartz2.CamelJob.execute(CamelJob.java:52)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
        at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560)
Caused by:
org.springframework.beans.factory.BeanCreationNotAllowedException: Error
creating bean with name 'myCamel': Singleton be
an creation not allowed while the singletons of this factory are in
destruction (Do not request a bean from a BeanFactory in a dest
roy method implementation!)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:21
0)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:285)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
        at
org.apache.camel.spring.spi.ApplicationContextRegistry.lookupByName(ApplicationContextRegistry.java:71)
        at
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByName(PropertyPlaceholderDelegateRegistry.java:50)
        ... 26 more



--
View this message in context: 
http://camel.465427.n5.nabble.com/Singleton-bean-creation-not-allowed-while-the-singletons-of-this-factory-are-in-destruction-during-sn-tp5713684p5743193.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to