Hi,
I am getting a BootstrapException when attempting to deploy my app to Tomcat. My current configuration works in both WebSphere and JBoss so I'm not sure if the problem is related to the lack of JTA or a JNDI context so I thought I'd ask.
First off I have a beanRefContext.xml file that holds references to all of my other configuration files :
<beans>
<bean name="mainApplicationContext" class="org.springframework.context.support.ClassPa thXmlApplicationContext">
<constructor-arg>
<list>
<value>/WEB-INF/applicationDS.xml</value>
<value>/WEB-INF/dataAccessContext-local.xml</value>
<value>/WEB-INF/applicationContext.xml</value>
</list>
</constructor-arg>
</bean>
</beans>
When attempting to run under Tomcat I get the following stack trace when deploying my app :
ERROR - ContextLoader.initWebApplicationContext(177) | Context initialization failed
org.springframework.beans.factory.access.Bootstrap Exception: Unable to return specified BeanFactory instance: factory key [mainApplicationContext], from group with resource name [classpath*:WEB-INF/beanRefContext.xml]; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'mainApplicationContext' is defined: org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans []; root of BeanFactory hierarchy
org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'mainApplicationContext' is defined: org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans []; root of BeanFactory hierarchy
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:351)
at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedBeanDefinition(AbstractBeanFa ctory.java:640)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.context.support.AbstractApplic ationContext.getBean(AbstractApplicationContext.ja va:536)
at org.springframework.beans.factory.access.Singleton BeanFactoryLocator.useBeanFactory(SingletonBeanFac toryLocator.java:399)
at org.springframework.web.context.ContextLoader.load ParentContext(ContextLoader.java:271)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:152)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 48)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4343)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDeployer.java:277)
at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployWARs( HostConfig.java:625)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:431)
at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:789)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:478)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:480)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:425)
I don't think its a classpath issue since it runs in JBoss just fine and JBoss uses Tomcat under the covers. So it has to be an environment issue, any ideas?
Thanks,
Dave


Reply With Quote
