Question

I have a web project built in eclipse using Spring and for Tomcat. Before some recent changes that I either cannot remember or undo, I could simply start the server in the ide and hit my servlets without issue. After making those changes, when I started the server, I got the stacktrace as follows.

SEVERE: 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:1484)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
...

To just work around this, I added all my jar dependencies to the server's class path explicitly, as described in the link below.

http://www.mkyong.com/spring/spring-error-classnotfoundexception-org-springframework-web-context-contextloaderlistener/

This is not the correct way to fix my issue. How can I get the server to operate as it was before?

Thanks very much!

Was it helpful?

Solution

It sounds like something got corrupted, which happens to me more often than I'd like. You might try cleaning your Tomcat server. Right-click on the server in the Servers view and select "Clean".

If that doesn't help, you can try dropping the server definition entirely, and recreating it from scratch. This doesn't require reinstalling Tomcat; just creating a new server definition within Eclipse.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top