tpurcell
Aug 6th, 2009, 11:40 AM
Hello
I have a web app with multiple applicationContect files so in my web.xml I have:
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext*.xml</param-value>
</init-param>
<load-on-startup>20</load-on-startup>
</servlet>
I've configured my message-broker a file named applicationContext-flex.xml in the following way:
<flex:message-broker services-config-path="classpath*:services-config.xml"/>
When my web app deploys I get the following message when the applicationContext files load:
DEBUG 2009-08-06 12:18:21,188 DEBUG [org.springframework.core.io.support.PathMatchingRe sourcePatternResolver] - Resolved location pattern [classpath*:applicationContext*.xml] to resources [file [/home/tpurcell/data/projects/busInTheClouds/enterprise-flex-war/enterprise-war/target/classes/applicationContext-file.xml], file [/home/tpurcell/data/projects/busInTheClouds/enterprise-flex-war/enterprise-war/target/classes/applicationContext-flex.xml], file [/home/tpurcell/data/projects/busInTheClouds/enterprise-flex-war/enterprise-war/target/classes/applicationContext-integration.xml]]
Spring starts to create the beans until it gets to the messageBroker. Then I get:
DEBUG 2009-08-06 11:38:41,893 DEBUG [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - Invoking afterPropertiesSet() on bean with name '_messageBroker'
INFO 2009-08-06 11:38:41,934 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@5e3a78ad: defining beans [org.springframework.integration.internalDefaultCon figuringBeanFactoryPostProcessor,org.springframewo rk.integration.file.config.FileWritingMessageHandl erFactoryBean#0,file-writer-channel-adapter,_messageBrokerHandlerAdapter,_messageBroke rDefaultHandlerMapping,_jsonConfigMapEditorConfigu rer,_messageBrokerMessagingProcessor,_flexRemoting AnnotationPostProcessor,_messageBrokerRemotingProc essor,org.springframework.flex.core.ExceptionTrans lationAdvice#0,org.springframework.flex.core.Endpo intServiceMessagePointcutAdvisor#0,org.springframe work.flex.core.MessageInterceptionAdvice#0,org.spr ingframework.flex.core.EndpointServiceMessagePoint cutAdvisor#1,_messageBrokerEndpointProcessor,_mess ageBroker,org.springframework.flex.messaging.integ ration.IntegrationAdapter#0,payload-flex-destination,connectionFactory,requestQueue,org.spr ingframework.integration.scheduling.IntervalTrigge r#0,poller,org.springframework.integration.channel .interceptor.WireTap#0,jmsin-channel,org.springframework.integration.jms.JmsDes tinationPollingSource#0,jmsin-channel-adapter,logging-channel-adapter,org.springframework.integration.handler.Lo ggingHandler#0,logging-channel-adapter.adapter,org.springframework.integration.ha ndler.BridgeHandler#0,org.springframework.integrat ion.config.ConsumerEndpointFactoryBean#0,payload-channel,nullChannel,errorChannel,org.springframewo rk.integration.handler.LoggingHandler#1,org.spring framework.integration.endpoint.EventDrivenConsumer #0,org.springframework.integration.channel.Message PublishingErrorHandler#0,taskScheduler]; root of factory hierarchy
DEBUG 2009-08-06 11:38:41,935 DEBUG [org.springframework.beans.factory.support.Disposab leBeanAdapter] - Invoking destroy() on bean with name 'taskScheduler'
INFO 2009-08-06 11:38:41,935 INFO [org.springframework.integration.scheduling.SimpleT askScheduler] - shutting down TaskExecutor
INFO 2009-08-06 11:38:41,935 INFO [org.springframework.scheduling.concurrent.ThreadPo olTaskExecutor] - Shutting down ThreadPoolExecutor
ERROR 2009-08-06 11:38:41,936 ERROR [org.springframework.web.servlet.DispatcherServlet] - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Flex configuration file does not exist at path: classpath*:services-config.xml
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:221)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
at
...
I'm running:
Apache Maven: 2.2.0 (r788681; 2009-06-26 09:04:01-0400)
Java version: 1.6.0_11
org.springframework: 2.5.5
org.springframework.integration: 1.0.3.RELEASE
org.springframework.flex: 1.0.0.RELEASE
I'm running using mvn jetty:run (jetty 6.1.14) but I packaged the app as a war and deployed to tomcat (6.0.16) and got the same result. Yes the file does exist:
tpurcell@linux-glk3:~/data/projects/busInTheClouds/enterprise-flex-war/enterprise-war/target/classes> ls -la
total 32
drwxr-xr-x 2 tpurcell users 4096 2009-08-06 12:18 .
drwxr-xr-x 4 tpurcell users 4096 2009-08-06 12:18 ..
-rw-r--r-- 1 tpurcell users 1015 2009-08-06 12:18 applicationContext-file.xml
-rw-r--r-- 1 tpurcell users 1488 2009-08-06 12:18 applicationContext-flex.xml
-rw-r--r-- 1 tpurcell users 3366 2009-08-06 12:18 applicationContext-integration.xml
-rw-r--r-- 1 tpurcell users 331 2009-08-06 12:18 commons-logging.properties
-rw-r--r-- 1 tpurcell users 867 2009-08-06 12:18 log4j.properties
-rw-r--r-- 1 tpurcell users 1249 2009-08-06 12:18 services-config.xml
I'm stuck. Any suggestions?
Thanks
Tom
I have a web app with multiple applicationContect files so in my web.xml I have:
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext*.xml</param-value>
</init-param>
<load-on-startup>20</load-on-startup>
</servlet>
I've configured my message-broker a file named applicationContext-flex.xml in the following way:
<flex:message-broker services-config-path="classpath*:services-config.xml"/>
When my web app deploys I get the following message when the applicationContext files load:
DEBUG 2009-08-06 12:18:21,188 DEBUG [org.springframework.core.io.support.PathMatchingRe sourcePatternResolver] - Resolved location pattern [classpath*:applicationContext*.xml] to resources [file [/home/tpurcell/data/projects/busInTheClouds/enterprise-flex-war/enterprise-war/target/classes/applicationContext-file.xml], file [/home/tpurcell/data/projects/busInTheClouds/enterprise-flex-war/enterprise-war/target/classes/applicationContext-flex.xml], file [/home/tpurcell/data/projects/busInTheClouds/enterprise-flex-war/enterprise-war/target/classes/applicationContext-integration.xml]]
Spring starts to create the beans until it gets to the messageBroker. Then I get:
DEBUG 2009-08-06 11:38:41,893 DEBUG [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - Invoking afterPropertiesSet() on bean with name '_messageBroker'
INFO 2009-08-06 11:38:41,934 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@5e3a78ad: defining beans [org.springframework.integration.internalDefaultCon figuringBeanFactoryPostProcessor,org.springframewo rk.integration.file.config.FileWritingMessageHandl erFactoryBean#0,file-writer-channel-adapter,_messageBrokerHandlerAdapter,_messageBroke rDefaultHandlerMapping,_jsonConfigMapEditorConfigu rer,_messageBrokerMessagingProcessor,_flexRemoting AnnotationPostProcessor,_messageBrokerRemotingProc essor,org.springframework.flex.core.ExceptionTrans lationAdvice#0,org.springframework.flex.core.Endpo intServiceMessagePointcutAdvisor#0,org.springframe work.flex.core.MessageInterceptionAdvice#0,org.spr ingframework.flex.core.EndpointServiceMessagePoint cutAdvisor#1,_messageBrokerEndpointProcessor,_mess ageBroker,org.springframework.flex.messaging.integ ration.IntegrationAdapter#0,payload-flex-destination,connectionFactory,requestQueue,org.spr ingframework.integration.scheduling.IntervalTrigge r#0,poller,org.springframework.integration.channel .interceptor.WireTap#0,jmsin-channel,org.springframework.integration.jms.JmsDes tinationPollingSource#0,jmsin-channel-adapter,logging-channel-adapter,org.springframework.integration.handler.Lo ggingHandler#0,logging-channel-adapter.adapter,org.springframework.integration.ha ndler.BridgeHandler#0,org.springframework.integrat ion.config.ConsumerEndpointFactoryBean#0,payload-channel,nullChannel,errorChannel,org.springframewo rk.integration.handler.LoggingHandler#1,org.spring framework.integration.endpoint.EventDrivenConsumer #0,org.springframework.integration.channel.Message PublishingErrorHandler#0,taskScheduler]; root of factory hierarchy
DEBUG 2009-08-06 11:38:41,935 DEBUG [org.springframework.beans.factory.support.Disposab leBeanAdapter] - Invoking destroy() on bean with name 'taskScheduler'
INFO 2009-08-06 11:38:41,935 INFO [org.springframework.integration.scheduling.SimpleT askScheduler] - shutting down TaskExecutor
INFO 2009-08-06 11:38:41,935 INFO [org.springframework.scheduling.concurrent.ThreadPo olTaskExecutor] - Shutting down ThreadPoolExecutor
ERROR 2009-08-06 11:38:41,936 ERROR [org.springframework.web.servlet.DispatcherServlet] - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Flex configuration file does not exist at path: classpath*:services-config.xml
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:221)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
at
...
I'm running:
Apache Maven: 2.2.0 (r788681; 2009-06-26 09:04:01-0400)
Java version: 1.6.0_11
org.springframework: 2.5.5
org.springframework.integration: 1.0.3.RELEASE
org.springframework.flex: 1.0.0.RELEASE
I'm running using mvn jetty:run (jetty 6.1.14) but I packaged the app as a war and deployed to tomcat (6.0.16) and got the same result. Yes the file does exist:
tpurcell@linux-glk3:~/data/projects/busInTheClouds/enterprise-flex-war/enterprise-war/target/classes> ls -la
total 32
drwxr-xr-x 2 tpurcell users 4096 2009-08-06 12:18 .
drwxr-xr-x 4 tpurcell users 4096 2009-08-06 12:18 ..
-rw-r--r-- 1 tpurcell users 1015 2009-08-06 12:18 applicationContext-file.xml
-rw-r--r-- 1 tpurcell users 1488 2009-08-06 12:18 applicationContext-flex.xml
-rw-r--r-- 1 tpurcell users 3366 2009-08-06 12:18 applicationContext-integration.xml
-rw-r--r-- 1 tpurcell users 331 2009-08-06 12:18 commons-logging.properties
-rw-r--r-- 1 tpurcell users 867 2009-08-06 12:18 log4j.properties
-rw-r--r-- 1 tpurcell users 1249 2009-08-06 12:18 services-config.xml
I'm stuck. Any suggestions?
Thanks
Tom