If you’re developing a spring-enabled web application using the combination of Eclipse, Tomcat and Maven. You might encounter the following error when you try to start tomcat within eclipse.
Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3773)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
You’ll need to configure your eclipse project settings by:
- Right click on the project in eclipse on the left panel under the package explorer view.
- Click Java EE Module Dependencies.
- Check (make sure the checkbox is ticked) the Maven Dependencies option (the last option).
Thanks, this really helped me! The error message didn’t really give that much information about the cause of the problem.
Thanks SO much for posting this. I have been going crazy trying to figure out whether my dependencies were wrong, or what!
I owe you a lunch!
Thanks a bunch for the info.
Thanks for this tip. It was valuable
Hello there,
I too get the same error, but when I try to follow your steps, there is no “Java EE Module Dependencies” under project properties. How do I proceed now?! I’m using Eclipse Helios for Java EE with Maven and Tomcat running from within Eclipse. Please help!
Thanks,
Trupti
2 trupi
Java EE Module Dependencies is replaced by Web Deployment Assembly
http://www.mkyong.com/eclipse/eclipse-java-ee-module-dependencies-is-replaced-by-web-deployment-assembly/