When I declare a directive on the jsp page:

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

I get an exception:

 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:176) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause java.lang.ClassNotFoundException: org.apache.jsp.index_jsp java.net.URLClassLoader.findClass(URLClassLoader.java:381) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:131) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:62) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:171) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 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/8.0.36 logs. Apache Tomcat/8.0.36 

my pom.xml:

 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>myTask</groupId> <artifactId>App</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>GuestApp</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project> 

Tell me: how to fix this problem. Thank.

  • Do you want to get a jar or war at the output? - Mikhail Vaysman
  • war. Does it affect this question? - uncleSAM

1 answer 1

Put the

 <packaging>war</packaging> 
  • I honestly do not know what helped. because yesterday threw out an exception. Then I tried to add different dependencies from hundreds of those that I found in Russian and English stackoverflow. Now everything is working fine with the salary that is specified in the question and with any of the types of the resulting file: both war and jar ... - uncleSAM
  • Try to make clean and collect again. In theory, jar will not work. Since by default it will not pack libraries. - Mikhail Vaysman
  • It may sound strange, but even after clean everything works for me with yesterday's settings. I replaced all the code in the memory with the one copied from my question yesterday. Norm work, the error is reproduced only if you remove from there jstl dependency ... Thanks for the help! - uncleSAM
  • one
    did you clean webapps from tomcat? if your old application is there, then there is a library there. - Mikhail Vaysman
  • Thanks to your question, I figured out a bit with the principle of Tomcat work. Until that moment, I ran the application in Tomcat from under intellij IDEA and it was almost the same as indicated by war or jar. Tomcat itself doesn’t give me the opportunity to download jar - only war. I understand that this is how it should be? - uncleSAM