Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext
This is a dependency to spring-web which isn't in the WAR's lib folder. I raised a JIRA for it: https://issues.apache.org/jira/browse/CAMEL-5472 You only have to add spring-web into your war/WEB-INF/lib folder. Best, Christian On Thu, Jul 26, 2012 at 12:30 PM, Gnanaguru S < [email protected]> wrote: > > Hi, > > I learning to deploy camel in Apache Tomcat. To start with I tried with > camel-example-cxf-tomcat from camel 2.10 distribution. > > I built the example using maven, It got successfully built and I found the > .war file from target directory. > > The moment I paste the .war, Tomcat shows a severe error. I cant trace the > issue. > > I got a doubt it might be because spring jars. Since Camel is bootstrapped > with Spring in case of deploying to web containers. But I get the same > error > even after placing the spring jars. > > Error in Tomcat: > > Jul 26, 2012 3:50:58 PM org.apache.catalina.core.StandardEngine > startInternal > INFO: Starting Servlet Engine: Apache Tomcat/7.0.29 > Jul 26, 2012 3:50:58 PM org.apache.catalina.startup.HostConfig > deployDirectory > INFO: Deploying web application directory > D:\CoE\Products\Tomcat\apache-tomcat-7 > .0.29\webapps\docs > Jul 26, 2012 3:50:58 PM org.apache.catalina.util.SessionIdGenerator > createSecure > Random > INFO: Creation of SecureRandom instance for session ID generation using > [SHA1PRN > G] took [215] milliseconds. > Jul 26, 2012 3:50:58 PM org.apache.catalina.startup.HostConfig > deployDirectory > INFO: Deploying web application directory > D:\CoE\Products\Tomcat\apache-tomcat-7 > .0.29\webapps\examples > Jul 26, 2012 3:50:59 PM org.apache.catalina.startup.HostConfig > deployDirectory > INFO: Deploying web application directory > D:\CoE\Products\Tomcat\apache-tomcat-7 > .0.29\webapps\host-manager > Jul 26, 2012 3:50:59 PM org.apache.catalina.startup.HostConfig > deployDirectory > INFO: Deploying web application directory > D:\CoE\Products\Tomcat\apache-tomcat-7 > .0.29\webapps\manager > Jul 26, 2012 3:50:59 PM org.apache.catalina.startup.HostConfig > deployDirectory > INFO: Deploying web application directory > D:\CoE\Products\Tomcat\apache-tomcat-7 > .0.29\webapps\ROOT > Jul 26, 2012 3:50:59 PM org.apache.coyote.AbstractProtocol start > INFO: Starting ProtocolHandler ["http-apr-8080"] > Jul 26, 2012 3:50:59 PM org.apache.coyote.AbstractProtocol start > INFO: Starting ProtocolHandler ["ajp-apr-8009"] > Jul 26, 2012 3:50:59 PM org.apache.catalina.startup.Catalina start > INFO: Server startup in 1009 ms > Jul 26, 2012 3:51:29 PM org.apache.catalina.startup.HostConfig deployWAR > INFO: Deploying web application archive > D:\CoE\Products\Tomcat\apache-tomcat-7.0 > .29\webapps\camel-example-cxf-tomcat.war > Jul 26, 2012 3:51:30 PM org.apache.catalina.core.ContainerBase > addChildInternal > SEVERE: ContainerBase.addChild: start: > org.apache.catalina.LifecycleException: Failed to start component > [StandardEngin > > e[Catalina].StandardHost[localhost].StandardContext[/camel-example-cxf-tomcat]] > at > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) > at > org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase > .java:901) > at > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87 > 7) > at > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) > > at > org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963) > > at > org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java: > 1600) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44 > 1) > at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec > utor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor > .java:908) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.lang.NoClassDefFoundError: > org/springframework/web/context/WebAp > plicationContext > at java.lang.Class.getDeclaredFields0(Native Method) > at java.lang.Class.privateGetDeclaredFields(Class.java:2291) > at java.lang.Class.getDeclaredFields(Class.java:1743) > at > org.apache.catalina.util.Introspection.getDeclaredFields(Introspectio > n.java:87) > at > org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(Web > AnnotationSet.java:261) > at > org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAn > notations(WebAnnotationSet.java:140) > at > org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotatio > ns(WebAnnotationSet.java:67) > at > org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfi > g(ContextConfig.java:382) > at > org.apache.catalina.startup.ContextConfig.configureStart(ContextConfi > g.java:858) > at > org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi > g.java:346) > at > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl > eSupport.java:119) > at > org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa > se.java:90) > at > org.apache.catalina.core.StandardContext.startInternal(StandardContex > t.java:5173) > at > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) > ... 11 more > Caused by: java.lang.ClassNotFoundException: > org.springframework.web.context.Web > ApplicationContext > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa > der.java:1711) > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa > der.java:1556) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) > ... 25 more > Jul 26, 2012 3:51:30 PM org.apache.catalina.startup.HostConfig deployWAR > SEVERE: Error deploying web application archive > D:\CoE\Products\Tomcat\apache-to > mcat-7.0.29\webapps\camel-example-cxf-tomcat.war > java.lang.IllegalStateException: ContainerBase.addChild: start: > org.apache.catal > ina.LifecycleException: Failed to start component > [StandardEngine[Catalina].Stan > dardHost[localhost].StandardContext[/camel-example-cxf-tomcat]] > at > org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase > .java:904) > at > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87 > 7) > at > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) > > at > org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963) > > at > org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java: > 1600) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44 > 1) > at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec > utor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor > .java:908) > at java.lang.Thread.run(Thread.java:619) > > > Please let me know, If any body has thoughts on this. > > Regards > Guru > @gnanagurus > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/camel-example-cxf-tomcat-deployment-errot-in-tomcat-tp5716503.html > Sent from the Camel - Users mailing list archive at Nabble.com. >
