PDA

View Full Version : ContextLoaderListener not found


ncl
Jul 13th, 2007, 12:31 PM
Hello all,

I'm trying to run one of the example programs from struts.apache.org. It's a struts2 + spring2 + hibernate3 project (http://struts.apache.org/2.0.8/docs/struts-2-spring-2-jpa-ajax.html). I'm getting this in the tomcat console:
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListe ner
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1359)
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1205)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3712)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4216)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:626)
at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.check(HostC onfig.java:1206)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:293)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.backgroundP rocess(ContainerBase.java:1306)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.processChildren(ContainerBase.ja va:1570)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.processChildren(ContainerBase.ja va:1579)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.run(ContainerBase.java:1559)
at java.lang.Thread.run(Thread.java:595)

Now, i totally don't get how this is possible. I triple checked and spring.jar is in my build path for sure and obviously it does contain that class.

I'm using:
- eclipse-3.2
- tomcat-5.5
- struts-2.0.8
- spring-2.0.6
- hibernate-3.2
- sun-jdk-1.5.0.11

I couldn't find the anwser on google and frankly the documentation seems a bit overwhelming - anyway i get the feeling its something not necessarily to do with spring but rather my total lack of knowledge of eclipse, tomcat etc. (although i managed to run the other struts example succesfully). So... any advice appreciated.

I can paste any files if necessary.

Marten Deinum
Jul 15th, 2007, 05:24 AM
Your build path and your applications/tomcat classpath are 2 different things. Make sure that when deploying your application that the spring.jar is in the WEB-INF/lib directory.

ncl
Jul 16th, 2007, 07:04 AM
Thanks, that does it. Everything works fine now.