0

I'm having this problem in starting web program even though there is no errors in my code. Here is the error code:

 org.apache.catalina.core.StandardContext listenerStart
 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:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4909)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
  • 1
    spring-web*.jar not in your classpath. Try to add it in WEB-INF.. – SMA Dec 22 '14 at 12:04
  • possible duplicate of [java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener in eclipse](http://stackoverflow.com/questions/21237339/java-lang-classnotfoundexception-org-springframework-web-context-contextloaderl) – atish shimpi Dec 22 '14 at 12:12

3 Answers3

0

If you are creating simple project without maven, need to follow following steps,

  1. download required jar files, e.g. I am using spring 4 so I have downloaded files from Index of release

  2. Then add this files inside your WebContent/WEB-INF/lib folder.

  3. Add jar files in build path (In eclipse : Right click on project -> Properties -> Java Build Path -> Add JARs...)

This will avoid org.springframework.web.context.ContextLoaderListener exception.

atish shimpi
  • 4,873
  • 2
  • 32
  • 50
0

Check if all the required jars are added on your classpath. The one because of which you are getting this error is - spring-web-<your_spring_version>.jar.

In case you are using a dynamic web project,

  1. Add all the required jars to your WEB-INF\lib folder.
  2. Refresh, clean and build project again.

If you are using Maven to build your project, make sure you add the dependencies to deployment assembly after running a Maven build-

  1. Right click on project in Eclipse
  2. Click Properties
  3. Select Deployment Assembly and click Add
  4. On the following dialog box, select Java Build Path Entries, select all the jars and click Ok.
Pramod Karandikar
  • 5,289
  • 7
  • 43
  • 68
0

As per the error you have posted, I think some of required jar files are missing. In thia line

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

You can see that your application is unable to find the required class.So please make sure that you have included all the required jar files or if you are using mavan than check for the all required maven dependencies.