无法为JSP编译类:无法解析类型java.util.Map $Entry。它是从所需的.class文件间接引用的

我不能得到tomcat7编译jsps。它直到运行示例servlet很好,服务启动并运行。我运行oracle java 8。

任何人都可以指向正确的方向?

这里是stacktrace:

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
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: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 of
a very basic SimpleTag handler with no body.</p>
<br>
<b><u>Result:</u></b>
<mytag:helloWorld/>
</body>
</html>
您必须使用支持JDK 8的更新版本的tomcat。

我可以确认apache-tomcat-7.0.35没有对JDK8的支持,我也可以确认apache-tomcat-7.0.50 DOES已经支持JDK8。

http://stackoverflow.com/questions/19243458/unable-to-compile-class-for-jsp-the-type-java-util-mapentry-cannot-be-resolved

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:无法为JSP编译类:无法解析类型java.util.Map $Entry。它是从所需的.class文件间接引用的