title: IntelliJ IDEA 12.1.4 with Tomcat 6: Unable to load class for JSP
body: <p>I have a web application with following directory structure:</p>
  
  <pre><code>  my-app
      [...]
      resources
        login.jsp
      [...]
      web
        [...]
        WEB-INF
          web.xml
  </code></pre>
  
  <p>When I try to run the application on Tomcat6, I get following errors:</p>
  
  <pre><code>org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:161)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:340)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  root cause
  
  org.apache.jasper.JasperException: Unable to load class for JSP
      org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:630)
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:340)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  root cause
  
  java.lang.ClassNotFoundException: org.apache.jsp.login_jsp
      java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      java.security.AccessController.doPrivileged(Native Method)
      java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
      org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:628)
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:340)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  </code></pre>
  
  <p>I read the answer to a <a href="https://stackoverflow.com/questions/4501829/unable-to-load-class-for-jsp">similar question</a> by BalusC, who suggested that this error might have been caused by a syntax error in the Java code inside <em>login.jsp</em>. But the file in question does not contain any Java code.</p>
  
  <p>How can I fix this error?</p>
  
  <p><strong>Update 1:</strong> I found following message in the logs:</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet jsp threw exception
  org.apache.jasper.JasperException: /login.jsp(6,0) The absolute uri: 
  http://java.sun.com/jsp/jstl/fmt cannot be resolved in either web.xml or the 
  jar files deployed with this application
      at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
      at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
      at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
      at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:300)
      at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:333)
      at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:442)
  </code></pre>