title: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener in eclipse
body: <p>I am doing a simple Spring MVC application(not using maven) which will print hello world on browser. It is a dynamic project in eclipse, so I put all the required jar files IN both build path as well as in <code>WEB-INF/lib</code> folder</p>
  
  <p>I tried two solutions and both didn't work.</p>
  
  <p><strong>Solutions I found:</strong></p>
  
  <ol>
  <li>cleaning tomcat work directory</li>
  <li>putting spring-mvc/spring-web.jar jar file in lib</li>
  </ol>
  
  <p>Here is my <code>web.xml</code></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app&gt;
  
      &lt;display-name&gt;Spring MVC Application&lt;/display-name&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/mvc-dispatcher-servlet.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>and there is no typo mistake in configuring the contextLoaderListener, then what is the problem, is there any other solution</p>
  
  <pre><code>Jan 20, 2014 8:16:39 PM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  Jan 20, 2014 8:16:39 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/7.0.11
  Jan 20, 2014 8:16:40 PM 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:1676)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
      at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
      at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
      at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4618)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5184)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5179)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      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)
  
  Jan 20, 2014 8:16:40 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Skipped installing application listeners due to previous error(s)
  Jan 20, 2014 8:16:40 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error listenerStart
  Jan 20, 2014 8:16:40 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/SpringSample] startup failed due to previous errors
  Jan 20, 2014 8:16:40 PM org.apache.coyote.AbstractProtocolHandler start
  INFO: Starting ProtocolHandler ["http-bio-8081"]
  Jan 20, 2014 8:16:40 PM org.apache.coyote.AbstractProtocolHandler start
  INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  Jan 20, 2014 8:16:40 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 4010 ms
  </code></pre>
  
  <p>eventually I am getting 404 error as my service is failed to loaded</p>