title: Why can't Eclipse find javax.servlet.ServletContextListener?
body: <p>I know it is a question that was already asked many times, but I tried almost all the solutions I found and it still does not work.</p>
  
  <p>I'm working with:</p>
  
  <ul>
  <li>Eclipse Kepler</li>
  <li>Java 7</li>
  <li>Maven</li>
  <li>Tomcat 6.0.37</li>
  </ul>
  
  <p>I'm trying to start the serverbut it fails because of :</p>
  
  <pre><code>INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
  Jul 13, 2015 3:30:54 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
  java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1595)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4149)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 29 more
  
  Jul 13, 2015 3:30:54 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
  java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1595)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4149)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 29 more
  
  Jul 13, 2015 3:30:54 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Error configuring application listener of class org.springframework.web.context.request.RequestContextListener
  java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1595)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4149)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletRequestListener
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 29 more
  </code></pre>
  
  <p>The first time I imported the project, the startup succeeded and the application was successful. But then it did not work anymore so I created a new workspace and I imported the project a second time in that new workspace, and that's where I got those errors.</p>
  
  <p>What I already tried so far :</p>
  
  <ul>
  <li>use Tomcat installation instead of workspace metadata</li>
  <li><a href="https://stackoverflow.com/questions/7849452/classnotfoundexception-with-servletcontextlistener">ClassNotFoundException with ServletContextlistener</a></li>
  <li><p><a href="https://stackoverflow.com/questions/25180880/java-lang-noclassdeffounderror-javax-servlet-servletcontextlistener-error">java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener error</a></p></li>
  <li><p>a lot of project/clean, Maven/update project, Server/clean</p></li>
  <li>server/open launch configuration -> I added <code>commons-logging-1.1.1.jar</code> and <code>spring-web-3.2.3.RELEASE.jar</code> to the classpath under <code>User entries</code></li>
  <li>when I was using workspace metadata, I also tried to copy and paste WEB-INF folder in the .plugin folder of metadata</li>
  <li>I also checked if the jars are in the .m2 folder and it seems to be ok</li>
  </ul>
  
  <p>Edit: 
  @Gimby
  My application is not yet deployed so I don't have any war file. But I do have a lib folder under WEB-INF : 
  apache-tomcat-6.0.37\wtpwebapps\msapp-web\WEB-INF\lib
  <img src="https://i.stack.imgur.com/PydDO.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/DieAc.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/nkHcZ.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/fvRrD.png" alt="enter image description here"></p>
  
  <p>These are the libraries in the apache Tomcat of the Build Path:
  <img src="https://i.stack.imgur.com/Ib0SY.png" alt="enter image description here"></p>