Tag Archives: unable to compile class for JSP

Maven project running servlet jump JSP error: HTTP status 500 – unable to compile class for JSP

Runtime environment: JDK1.8 + Tomcat 6.0. x (maven comes with)

1. Error details

exception:
org.apache.jasper. JasperException: Unable to compile class for JSP:
An error occurred at line: 1 in the generated java file
The type java.io. ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files…


Look at the console error again

2. the cause of the problem:
maven use skeleton to create web projects, the default tomcat is 6.0, tomcat version is too low or jdk version is high.
3. problem solving:
Method 1: Use a high version of tomcat. Method 2: Use a lower version of jdk. I was using jdk1.8, the results reported an error. After replacing jdk1.7, it ran successfully without errors.

Run successfully: