You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by cmoulliard <cm...@gmail.com> on 2009/03/10 16:49:21 UTC

Error creating bean with name 'reportIncident': Initialization of bean failed; nested exception is java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

Hi,

Spring creates a strange error with a Camel osgi bundle :

16:43:35,937 | INFO  | localShell       | CommandLineExecutorImpl          |
om.shell.CommandLineExecutorImpl   64 | Executing (String): update 54
16:43:35,937 | INFO  | localShell       | CommandLineExecutorImpl          |
om.shell.CommandLineExecutorImpl  104 | Executing (update): [54]
16:43:36,140 | INFO  | localShell       | ultOsgiApplicationContextCreator |
ultOsgiApplicationContextCreator   67 | Discovered configurations
{osgibundle:/META-INF/spring/*.xml} in bundle [Report Incident Interfaces
Bundle (reportincident.interfaces)]
16:43:36,156 | INFO  | xtenderThread-13 | OsgiBundleXmlApplicationContext  |
pport.AbstractApplicationContext  411 | Refreshing
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@e107d9:
display name
[OsgiBundleXmlApplicationContext(bundle=reportincident.interfaces,
config=osgibundle:/META-INF/spring/*.xml)]; startup date [Tue Mar 10
16:43:36 CET 2009]; root of context hierarchy
16:43:36,156 | INFO  | xtenderThread-13 | XmlBeanDefinitionReader          |
tory.xml.XmlBeanDefinitionReader  323 | Loading XML bean definitions from
URL [bundle://54.0:0/META-INF/spring/camel-context.xml]
16:43:36,281 | INFO  | xtenderThread-13 | OsgiBundleXmlApplicationContext  |
pport.AbstractApplicationContext  426 | Bean factory for application context
[org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@e107d9]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@ba936a
16:43:36,296 | INFO  | xtenderThread-13 | WaiterApplicationContextExecutor |
WaiterApplicationContextExecutor  245 | No outstanding OSGi service
dependencies, completing initialization for
OsgiBundleXmlApplicationContext(bundle=reportincident.interfaces,
config=osgibundle:/META-INF/spring/*.xml)
16:43:36,328 | INFO  | xtenderThread-14 | DefaultCamelContext              |
e.camel.impl.DefaultCamelContext  118 | JMX enabled. Using
InstrumentationLifecycleStrategy.
16:43:36,437 | INFO  | xtenderThread-14 | OsgiBundleXmlApplicationContext  |
Context$BeanPostProcessorChecker  121 | Bean
'org.apache.camel.example.reportincident.routing.FileComponent' is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxying)
16:43:36,437 | INFO  | xtenderThread-14 | OsgiBundleXmlApplicationContext  |
Context$BeanPostProcessorChecker  121 | Bean 'camelContext' is not eligible
for getting processed by all BeanPostProcessors (for example: not eligible
for auto-proxying)
16:43:36,437 | INFO  | xtenderThread-14 | OsgiBundleXmlApplicationContext  |
Context$BeanPostProcessorChecker  121 | Bean 'camelContext' is not eligible
for getting processed by all BeanPostProcessors (for example: not eligible
for auto-proxying)
16:43:36,437 | INFO  | xtenderThread-14 | DefaultListableBeanFactory       |
pport.DefaultListableBeanFactory  414 | Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@ba936a:
defining beans
[bindyDataformat,csv,webService,OK,activemq,reportIncident,camelContext:beanPostProcessor,camelContext];
root of factory hierarchy
16:43:36,453 | INFO  | xtenderThread-14 | DefaultListableBeanFactory       |
ort.DefaultSingletonBeanRegistry  421 | Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@ba936a:
defining beans
[bindyDataformat,csv,webService,OK,activemq,reportIncident,camelContext:beanPostProcessor,camelContext];
root of factory hierarchy
16:43:36,453 | ERROR | xtenderThread-14 | OsgiBundleXmlApplicationContext  |
gatedExecutionApplicationContext  366 | Post refresh error
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'reportIncident': Initialization of bean failed; nested exception
is java.lang.IllegalStateException: BeanFactory not initialized or already
closed - call 'refresh' before accessing beans via the ApplicationContext
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
	at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
	at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:68)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:343)
	at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:308)
	at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:138)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: BeanFactory not initialized or
already closed - call 'refresh' before accessing beans via the
ApplicationContext
	at
org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:153)
	at
org.springframework.context.support.AbstractApplicationContext.getBeanDefinitionNames(AbstractApplicationContext.java:929)
	at
org.apache.cxf.configuration.spring.ConfigurerImpl.initWildcardDefinitionMap(ConfigurerImpl.java:77)
	at
org.apache.cxf.configuration.spring.ConfigurerImpl.addApplicationContext(ConfigurerImpl.java:223)
	at
org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(BusWiringBeanFactoryPostProcessor.java:118)
	at
org.apache.camel.component.cxf.spring.CxfEndpointBeanDefinitionParser$CxfSpringEndpointBean.setApplicationContext(CxfEndpointBeanDefinitionParser.java:169)
	at
org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
	... 16 more


Any idea how to solve this ?

Regards,

Charles Moulliard
SOA Architect

-----
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/Error-creating-bean-with-name-%27reportIncident%27%3A-Initialization-of-bean-failed--nested-exception-is-java.lang.IllegalStateException%3A-BeanFactory-not-initialized-or-already-closed---call-%27refresh%27-before-accessing-beans-via-the-ApplicationContext-tp22437201p22437201.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.