ContextLoaderListener creates a root web-application-context for the web-application and puts it in the ServletContext. This context can be used to load and unload the spring-managed beans ir-respective of what technology is being used in the controller layer(Struts or Spring MVC).
I had a similar problem when running a spring web application in an Eclipse managed tomcat. I solved this problem by adding maven dependencies in the project's web deployment assembly.
You should see "Maven Dependencies" added to the Web Deployment Assembly definition.
Same thing happens to me from time to time when using Eclipse WDT. Its specialy frustrating when this happens to a unmodified and previously working project. This is what I do to fix it in this last scenario:
This usually fixes the issue you mention.
I used IntelliJ IDEA, compilation is successful, but when starting Tomcat, it says:
Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
In the beginning, I thought the JAR was missing, but it was in place.
Solution:
File > Project Structure > Artifacts
, in the Output Layout
double click in right panel Available Elements
the library named like Maven:...
, it will be moved to WEB-INF/lib
in the left pane.
Accept and restart Tomcat.
You could try "Clean Tomcat Work Directory" or simply "Clean..". This supposed to discard all published state and republish from scratch.
This is surely Eclipse related issue. The thing which worked for me is creating a new server in eclipse server tab. Then run your application in this new server, it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With