1. 程式人生 > >HTTP Status 500 - Unable to compile class for JSP 問題解決

HTTP Status 500 - Unable to compile class for JSP 問題解決

今天除錯程式碼,發現丟擲這個異常:

HTTP Status 500 - Unable to compile class for JSP:

type Exception report



message Unable to compile class for JSP:



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



exception



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



An error occurred at line: [1] in the generated java file: [/data/services/tomcat_base/service.xxxxxxx/work/Catalina/localhost/_/org/apache/jsp/WEB_002dINF/content/auth/login_005ffail_jsp.java]

The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files



Stacktrace:

 org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)

 org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)

 org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:490)

 org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)

 org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)

 org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)

 org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662)

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

 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)

 org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:209)

 org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:267)

 org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1221)

 org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1005)

 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:952)

 org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)

 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)

 org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)

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

 org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)

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

 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

 org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

 com.yy.vip.filter.XssFilter.doFilter(XssFilter.java:29)

 com.yy.vip.shared.commons.filter.AbstractPreHandleFilter.doFilter(AbstractPreHandleFilter.java:76)

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

根據提示,是tomcat沒有把jsp成功編譯成class檔案,導致程序執行時,請求找不到相應的jsp.

解決問題思路:

1.版本衝突,伺服器java版本1.8, pom.xml的配置java版本配置成1.8

2.包衝突 tomcat沒有生成相應的class檔案,可能是tomcat1.7 jdk1.8,  刪除 /data/services/tomcat-7.0.42.6/lib下的ecj-3.7.2.jar

重啟即可