Bug 57445 - java.util.Map$Entry cannot be resolved - jsp's no longer compile under java8
Summary: java.util.Map$Entry cannot be resolved - jsp's no longer compile under java8
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 7.0.56
Hardware: All Linux
: P2 critical (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-15 10:09 UTC by Ralf Hauser
Modified: 2015-01-16 19:03 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Hauser 2015-01-15 10:09:28 UTC
with tc7.0.28 from current debian stable I got the problem.

As per http://stackoverflow.com/questions/19243458/tomcat7-not-compiling-jsp-examples , I got a 7.0.56, but the problem still persists

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

An error occurred at line: [1] in the generated java file: [my_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:477)
	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:657)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
	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:727)

Even when doing the also recommended

<%@page import="java.util.Map" %><%@ page import="java.util.HashMap" %>

java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Comment 1 Christopher Schultz 2015-01-15 16:23:02 UTC
Care to post a sample JSP?

Are you sure you don't have an old ECJ library laying around?
Comment 2 Ralf Hauser 2015-01-16 09:25:01 UTC
thanks, had eclipse-ecj-3.5.1.jar

now have /usr/share/java/eclipse-ecj-4.4.jar
-----------
and if after installing the jar there, you see

java.util.MissingResourceException: Can't find bundle for base name org.eclipse.jdt.internal.compiler.parser.readableNames, locale en_US
	java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
	java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
	java.util.ResourceBundle.getBundle(ResourceBundle.java:845)
	org.eclipse.jdt.internal.compiler.parser.Parser.readReadableNameTable(Parser.java:710)
	org.eclipse.jdt.internal.compiler.parser.Parser.initTables(Parser.java:604)

then you better change the permissions on the file.   ;)

If you then see 

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jdt.internal.compiler.parser.Parser
	org.eclipse.jdt.internal.compiler.Compiler.initializeParser(Compiler.java:681)
	org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:282)

you better restart eclipse and the tomcat therein