Bug 66582 - Can't reference static fields declared in interfaces in JSP pages: javax.el.ELException: The class [...] must be public, in an exported package (for Java 9+), non-abstract and not an interface
Summary: Can't reference static fields declared in interfaces in JSP pages: javax.el.E...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 9.0.72
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-27 16:00 UTC by Dmitry Treskunov
Modified: 2023-05-02 12:33 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Treskunov 2023-04-27 16:00:06 UTC
On a JSP page we have the following import:

<%@ page import="static jetbrains.buildServer.auth.SessionModel.KEY_ENABLE_LOGOUT_ALL_SESSIONS" %>

After upgrading to Tomcat 9.0.72, it stopped working with the following error:

javax.el.ELException: The class [jetbrains.buildServer.auth.SessionModel] must be public, in an exported package (for Java 9+), non-abstract and not an interface
	at javax.el.ImportHandler.findClass(ImportHandler.java:455) ~[el-api.jar:3.0.FR]
	at javax.el.ImportHandler.importStatic(ImportHandler.java:297) ~[el-api.jar:3.0.FR]
	at org.apache.jasper.runtime.PageContextImpl.getELContext(PageContextImpl.java:710) ~[jasper.jar:9.0.74]
	at org.apache.jasper.runtime.JspContextWrapper.getELContext(JspContextWrapper.java:513) ~[jasper.jar:9.0.74]
	at org.apache.jsp.tag.web.ext.includeExtensions_tag.doTag(includeExtensions_tag.java:157) ~[?:?]
	at org.apache.jsp.profile.userGeneralSettings_jsp._jspService(userGeneralSettings_jsp.java:264) ~[?:?]
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[jasper.jar:9.0.74]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[servlet-api.jar:4.0.FR]
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:466) ~[jasper.jar:9.0.74]
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) ~[jasper.jar:9.0.74]
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327) ~[jasper.jar:9.0.74]


"jetbrains.buildServer.auth.SessionModel" is indeed an interface, but to me this looks like a valid usage of the import statement
Comment 1 Mark Thomas 2023-04-27 16:18:36 UTC
This is a regression caused by fixing bug 66441.

The import is valid for a JSP but not for EL. I'll get this fixed for the May releases.
Comment 2 Mark Thomas 2023-05-02 12:33:41 UTC
Fixed in:
- 11.0.x for 11.0.0-M6 onwards
- 10.1.x for 10.1.9 onwards
-  9.0.x for  9.0.75 onwards
-  8.5.x for  8.5.89 onwards