Java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.pages.LandingPage_jsp

When I open a project, I have two very strange errors. If I open the landing page and keep updating it, error messages alternate between the two below.

Or I get this:

org.apache.jasper.JasperException: /WEB-INF/pages/LandingPage.jsp (line: 2, column: 0) The absolute uri: http://www.springframework.org/security/tags cannot be resolved in either web.xml or the jar files deployed with this application 

Or that:

 HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.pages.LandingPage_jsp 

What is happening on earth?

+6
source share
7 answers

Because:

Reason 1 : JSP file error analysis. For example: JSP page error (syntax error or missing dependencies):

 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@page session="false" %> <html> <head> <title>Home</title> </head> <body> <h1>Hello world!</h1> <p>The time on server is ${serverTime}.</p> </body> </html> 

Do it right:

 <%@page session="false" %> <html> <head> <title>Home</title> </head> <body> <h1>Hello world!</h1> <p>The time on server is ${serverTime}.</p> </body> </html> 

Reason 2 : lack of dependencies. Fix it by adding these dependencies:

 <dependency> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>jstl-api</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.2</version> <scope>provided</scope> </dependency> 

You must set the scope as above.

+2
source

I also had the same problem. This was resolved by changing the version of the tomcat plugin from 2.0 to 2.2.

 <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> </plugin> 
+1
source

I had this error:
HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.views.index_jsp

In index.jsp, I have a line:
<%@include file="header.jsp"%>
But the pure file name is Header.jsp. Take a look at your LandingPage.jsp (row: 2, column: 0). Good luck

0
source

Here you have some line of code that cannot be executed. Take a close look at your code. I also put unnecessary code on my jsp page, for example

 <spring:url value="/page.html"> 

Good luck

0
source

In my case, AOP reported that I could speed up the launch of tomcat and webapp by adding banks to the catalina section. tomcat.util.scan.StandardJarScanFilter.jarsToSkip, including jstl-1.2.jar.

Do not listen to this advice; only sadness will come out of it.

0
source

I had the same problem when deploying to a remote server. But my project worked perfectly on the local server.

After much work, my problem was the script file that was used for the tomcat folder. Share this if you want someone in the future to need the same problem

 #!/bin/bash # description: Tomcat Start Stop Restart # processname: tomcat # chkconfig: 234 20 80 JAVA_HOME=/opt/jdk1.8.0_60 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH export TOMCAT_HOME=/usr/tomcat7 export JEE_JAR=$JAVA_HOME export JRE_HOME=$JAVA_HOME export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar CATALINA_HOME=/usr/tomcat7 case $1 in start) sh $CATALINA_HOME/bin/startup.sh ;; stop) sh $CATALINA_HOME/bin/shutdown.sh ;; restart) sh $CATALINA_HOME/bin/shutdown.sh sh $CATALINA_HOME/bin/startup.sh ;; esac exit 0 
0
source

In my case, a simple rebuild-redeploy application helped me resolve a similar exception. Some resources (jsp?) Seem to be missing from the original build.

0
source

Source: https://habr.com/ru/post/973964/


All Articles