title: java.lang.NoClassDefFoundError: HttpSessionListener
body: <p>I am trying to deploy a war that i didnt write and i am getting this error in my logs:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: HttpSessionListener
  </code></pre>
  
  <p>i know that HttpSessionListener lives in <strong>servlet-api.jar</strong> which is found in the lib dir of tomcat(my app server).</p>
  
  <p>I tried including servlet-api.jar in the war's WEB-INF/lib folder, but the logs yelled at me for doing that:</p>
  
  <pre><code>INFO: validateJarFile(/home/test/apache-tomcat-6.0.18/webapps/test/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
  </code></pre>
  
  <p>the internets claim that you dont have to include that class in your lib folder.</p>
  
  <p><strong>edit:</strong>
  i removed the offending listener (which was causing the problem above) from web.xml because it didnt look very important. this revealed more errors:</p>
  
  <pre><code>java.lang.Error: Unresolved compilation problem: 
      The type javax.servlet.FilterChain cannot be resolved. It is indirectly referenced from required .class files
  </code></pre>
  
  <p>what am i missing?</p>