Bug 1337940 - Tomcat 7.0.65 does not compile JSPs with JDK 8 (even not simplest official Apache Tomcat Sample war file)
Summary: Tomcat 7.0.65 does not compile JSPs with JDK 8 (even not simplest official Ap...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: tomcat
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Coty Sutherland
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: fst_owner=dcafaro, fst_ping=1
Depends On: 1336481
Blocks: 1357654
TreeView+ depends on / blocked
 
Reported: 2016-05-20 13:52 UTC by Andreas M. Oberheim
Modified: 2017-03-21 12:11 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1154978
Environment:
Last Closed: 2017-03-21 12:11:45 UTC
Type: Bug


Attachments (Terms of Use)

Description Andreas M. Oberheim 2016-05-20 13:52:35 UTC
+++ This bug was initially created as a clone of Bug #1154978 +++

Description of problem:

Tomcat 7.0.65 does not compile JSPs (even not simplest official Apache Tomcat Sample war file)

Delivered Error Page:

====

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: [/usr/share/tomcat7_2/work/Catalina/localhost/sample/org/apache/jsp/hello_jsp.java]
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: [1] in the generated java file: [/usr/share/tomcat7_2/work/Catalina/localhost/sample/org/apache/jsp/hello_jsp.java]
The type java.io.ObjectInputStream 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:466)
	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)

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

====

Version-Release number of selected component:

Affects RHEL 6.8 System (redhat-release-server-6Server-6.8.0.5.el6.x86_64)
openjdk version "1.8.0_91" OpenJDK Runtime Environment (build 1.8.0_91-b14) OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
Apache Tomcat/7.0.65  ( tomcat-el-2.2-api-7.0.65-1.el6.noarch ) 


How reproducible: Always


Actual results: 
delivers HTTP Status 500 ... org.apache.jasper.JasperException: Unable to compile class for JSP ...

Expected results:
compiles JSP and deliver generated HTML page

Additional info:
When replacing the ...ecj...jar with the newest ECJ 4.5.1 compiling of JSPs is successful (but not on every RHEL 6.8 System)

There may be a workaround that seems to be very hakish:
Deinstalling and reinstalling JDK 7 & 8 and then deinstalling JDK 7
https://k4nz4k1g4w4.wordpress.com/2015/11/12/centosredhat-6-2-tomcat7-java1-8-the-type-java-util-mapentry-cannot-be-resolved/

Comment 1 Andreas M. Oberheim 2016-05-20 13:58:55 UTC
newest ECJ was downloaded from MVN:
http://mvnrepository.com/artifact/org.eclipse.jdt.core.compiler/ecj/4.5.1

Sample war that was used to reproduce bug:
https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/

Comment 2 Coty Sutherland 2016-05-20 14:09:02 UTC
Thanks for the report, but I'm already tracking this issue. Please see the original bug and it's ECJ blocker bug for more information. 

Additionally note that if you you're running the latest Java8 release you could try downgrading to the previous update to work around this; the latest updated changed the java.io.ObjectInputStream class and made it incompatible with RHEL6's current ECJ version.

*** This bug has been marked as a duplicate of bug 1223609 ***

Comment 3 Coty Sutherland 2016-05-20 14:37:08 UTC
Actually, the bug was just filed against the wrong product. I'm cleaning it up and moving it to Fedora EPEL since it's EPEL tomcat (tomcat 7, not RHEL6/tomcat6). The problem is still the same though; ECJ needs an upgrade to work with Java8 so I added the blocker for that.

Comment 4 Coty Sutherland 2017-03-21 12:11:45 UTC
The ECJ update (bug 1336481) has been released.


Note You need to log in before you can comment on or make changes to this bug.