無法為JSP編譯類:無法解析類型java.util.Map $ Entry從所需的.class文件間接引用它
你必須使用支持JDK 8的最新版本的tomcat。
我可以確認apache-tomcat-7.0.35不支持JDK8,也可以確認apache-tomcat-7.0.50不支持JDK8。
解決方法我無法獲取tomcat7來編譯jsps。直到運行示例servlet一切正常,并且服務已啟動并正在運行。我正在運行oracle java 8。
誰能指出我正確的方向?
這是堆棧跟蹤:
type Exception reportmessage Unable to compile class for JSP:description The server encountered an internal error that prevented it from fulfilling this request.exceptionorg.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 1 in the generated java fileThe type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class filesStacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468) org.apache.jasper.compiler.Compiler.compile(Compiler.java:378) org.apache.jasper.compiler.Compiler.compile(Compiler.java:353) org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:728)note The full stack trace of the root cause is available in the Apache Tomcat/7.0.35 logs.
該代碼看起來像這樣,這是來自tomcat7的示例代碼,所以我想這是正確的。
<%@ taglib prefix="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %><html><head> <title>JSP 2.0 Examples - Hello World SimpleTag Handler</title></head><body><h1>JSP 2.0 Examples - Hello World SimpleTag Handler</h1><hr><p>This tag handler simply echos "Hello,World!" It’s an example ofa very basic SimpleTag handler with no body.</p><br><b><u>Result:</u></b><mytag:helloWorld/></body></html>
相關文章:
1. 視頻文件不能播放,怎么辦?2. mysql - 把一個表中的數據count更新到另一個表里?3. 請教使用PDO連接MSSQL數據庫插入是亂碼問題?4. mysql 查詢身份證號字段值有效的數據5. visual-studio - Python OpenCV: 奇怪的自動補全問題6. mysql - 分庫分表、分區、讀寫分離 這些都是用在什么場景下 ,會帶來哪些效率或者其他方面的好處7. node.js - nodejs開發中常用的連接mysql的庫8. python bottle跑起來以后,定時執行的任務為什么每次都重復(多)執行一次?9. python - 爬蟲模擬登錄后,爬取csdn后臺文章列表遇到的問題10. Python爬蟲如何爬取span和span中間的內容并分別存入字典里?
