執行web專案報錯

泗水六年發表於2020-10-08

問題:

HTTP Status 500 -

type Exception report

 

message

 

description The server encountered an internal error () that prevented it from fulfilling this request.

 

exception

 

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)

root cause

 

org.apache.jasper.JasperException: Unable to load class for JSP

org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:620)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)

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:134)

org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)

org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.

 

Apache Tomcat/6.0.20

 

 

 

 

九月 06, 2020 1:53:36 下午 org.apache.catalina.core.StandardWrapperValve invoke

嚴重: Servlet.service() for servlet jsp threw 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

 

Stacktrace:

at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)

at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)

at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)

at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)

at java.lang.Thread.run(Thread.java:748)

 

九月 06, 2020 1:53:37 下午 org.apache.catalina.core.StandardWrapperValve invoke

嚴重: Servlet.service() for servlet jsp threw exception

java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)

at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)

at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)

at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)

at java.lang.Thread.run(Thread.java:748)

 

九月 06, 2020 1:53:40 下午 org.apache.catalina.core.ApplicationContext log

資訊: ContextListener: contextInitialized()

九月 06, 2020 1:53:40 下午 org.apache.catalina.core.ApplicationContext log

資訊: SessionListener: contextInitialized()

 

原因:

tomcat與jdk版本不一致

 

解決:

tomcat版本問題,之前用的apache-tomcat-6.0.20,jdk用的是1.8,更換為apache-tomcat-7.0.52,可以用了正常執行訪問。

相關文章