https://bz.apache.org/bugzilla/show_bug.cgi?id=65599

            Bug ID: 65599
           Summary: Tomcat 8.5 cannot compile JSPs with Java 17 (System
                    cannot be resolved)
           Product: Tomcat 8
           Version: 8.5.71
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
          Assignee: dev@tomcat.apache.org
          Reporter: denis.fuenzal...@microsoft.com
  Target Milestone: ----

Created attachment 38049
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38049&action=edit
Catalina output with the stacktrace when attempting to compile the JSP in Java
17

When running the latest Tomcat 8.5.71 with Java 17, it seems the version of ECL
bundled with Tomcat is too old and cannot load the classes from the JDK,
resulting in an error when compiling trivial JSPs like the following:

        <%@ page session="false" pageEncoding="UTF-8" contentType="text/html;
charset=UTF-8" %>
        <!DOCTYPE html>
        <html>
          <body>
                <%= System.getProperty("os.name") %>
          </body>
        </html>

The error looks like:

        HTTP Status 500 – Internal Server Error
        Type Exception Report

        Message Unable to compile class for JSP:

        Description The server encountered an unexpected condition that
prevented it from fulfilling the request.

        Exception

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

        An error occurred at line: [5] in the jsp file: [/index.jsp]
        System cannot be resolved
        2: <!DOCTYPE html>
        3: <html>
        4:   <body>
        5:     <%= System.getProperty("os.name") %>
        6:   </body>
        7: </html>

We've found that replacing the ECL Jar bundled with Tomcat 8.5.71
(ecj-4.6.3.jar) with the version from Tomcat 9.0.53 (ecj-4.20.jar) fixes the
issue.

We've tested this occurs with JDKs from multiple vendors including Adoptium,
Oracle (from jdk.java.net) and Azul.

Kind regards,

-- Denis

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to