HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp due to taglib

18,850

Finally I resolved the issue by myself. Below are steps:

1.Download jstl-1.2.jar and standard-1.1.2.jar from below links.

http://repo2.maven.org/maven2/javax/servlet/jstl/

http://repo2.maven.org/maven2/taglibs/standard/

2.Copy the two files into Tomcat lib folder.

3.Rename standard-1.1.2.jar to standard.jar.

The exception disappears then.

Share:
18,850

Related videos on Youtube

appleleaf
Author by

appleleaf

Updated on June 04, 2022

Comments

  • appleleaf
    appleleaf almost 2 years

    I create a jsp project with idea 2016 and the code of jsf is as following.

     <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    
    <html>
    <head>
      <title>JSP 2.0 Expression Language - Implicit Objects</title>
    </head>
    <body>
    <h1>JSP 2.0 Expression Language - Implicit Objects</h1>
    <hr>
    This example illustrates some of the implicit objects available
    in the Expression Language.  The following implicit objects are
    available (not all illustrated here):
    <ul>
      <li>pageContext - the PageContext object</li>
      <li>pageScope - a Map that maps page-scoped attribute names to
        their values</li>
      <li>requestScope - a Map that maps request-scoped attribute names
        to their values</li>
      <li>sessionScope - a Map that maps session-scoped attribute names
        to their values</li>
      <li>applicationScope - a Map that maps application-scoped attribute
        names to their values</li>
      <li>param - a Map that maps parameter names to a single String
        parameter value</li>
      <li>paramValues - a Map that maps parameter names to a String[] of
        all values for that parameter</li>
      <li>header - a Map that maps header names to a single String
        header value</li>
      <li>headerValues - a Map that maps header names to a String[] of
        all values for that header</li>
      <li>initParam - a Map that maps context initialization parameter
        names to their String parameter value</li>
      <li>cookie - a Map that maps cookie names to a single Cookie object.</li>
    </ul>
    
    </body>
    </html>
    

    I got following error info.

    HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
    
    type Exception report
    
    message java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
    
    description The server encountered an internal error that prevented it from fulfilling this request.
    
    exception
    
    org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
        org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:376)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    
    root cause
    
    java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
        java.net.URLClassLoader$1.run(URLClassLoader.java:372)
        java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        java.security.AccessController.doPrivileged(Native Method)
        java.net.URLClassLoader.findClass(URLClassLoader.java:360)
        org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
        org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
        org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:376)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    
    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.69 logs.
    Apache Tomcat/7.0.69
    

    After I remove below line, the exception disappears.

    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    

    I downloaded jstl-1.2.jar and added it into external libraries of my project. The issue is still there. Anybody knows how to handle or debug the issue?

    • Yazan
      Yazan about 7 years
      i am not sure which JAR file you need, but you need to make sure it's placed in web-inf/lib dir of your website
    • CrazyCoder
      CrazyCoder about 7 years
      Did you add the jars to the artifact you deploy on the server?