An exception occurred when I was executing my program in command prompt. The exception says ClassNotFoundException. How can I remove this exception? How can this be resolved?
ClassNotFoundException: Org.springframework.web.context.ContextLoaderListener
If you want to access the servlet context when starting your web application, spring will provide a ContextLoaderListener that can be easily pasted into the web.xml file. Some of the most common use cases of ContextLoaderListener are:
1) If I want to load static data or configuration data from the database when starting the web application and keep it in memory.
2) At startup and before deleting my web application, if I want to be notified.
3) If I want to have a programmatic configuration of spring instead of a static context file.
Then configure your web.xml file ensuring spring-web.jar in pom.xml in this way:
<listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId>Â <version>3.2.0.RELEASE</version></dependency>