title: Tomcat goes to .m2 directory for the jsp, servlet, etc. jars and crashes
body: <p>I am having trouble getting Tomcat to run JSPs on my maven-enabled project (Eclipse 3.7 with latest m2 plugin on Tomcat 6, running as a server in Eclipse Java EE):</p>
  
  <pre><code>java.lang.NullPointerException
      at org.apache.jsp.index_jsp._jspInit(index_jsp.java:22)
  </code></pre>
  
  <p>This error indicates that the Tomcat-supplied jars for JSP, servlet, etc. are clashing with project jars. It does appear that everything is set up properly, though:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
    &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
    &lt;version&gt;2.5&lt;/version&gt;
    &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
    &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
    &lt;version&gt;2.1&lt;/version&gt;
    &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>If I turn on class tracing on the VM, I see that upon startup the jsp jar from Tomcat's lib directory is being used for JspFactory:</p>
  
  <pre><code>[Loaded javax.servlet.jsp.JspFactory from file:/C:/tomcat-6.0.28/lib/jsp-api.jar]
  </code></pre>
  
  <p>When the server is up and I'm ready to hit the jsp page for the first time, however, I get a different result:</p>
  
  <pre><code>[Loaded javax.servlet.jsp.JspFactory from file:/C:/Users/alice/.m2/repository/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar]
  </code></pre>
  
  <p>So, for some reason that is beyond me, the jsp jar from the m2 repo is being used by the web application, even though the scope in the pom.xml is set to provided. I've exhausted google searching. What <strong>other</strong> configuration issues might be causing this problem?</p>