Description of problem: When trying to access public method/field of non-public class via EL I get "java.lang.IllegalAccessException: Class javax.el.BeanELResolver can not access a member of class X with modifiers "private"". This is apparently caused by JDK-4071957 [1], but since that is opened for over 16 years, it should be probably worth it to implement a workaround. Workaround for this issue is setting setAccessible(true) on the method before invoking it, thus suppress Java access checking. I have attached a simple reproducer app as well as a stack trace of the exception. These attachments can be found in the JIRA [2]. [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4071957 [2] https://issues.jboss.org/browse/WFLY-2493 Version-Release number of selected component (if applicable): jboss-el-api_2.2_spec-1.0.2.Final
Jonáš Trantina <jtrantin> made a comment on jira WFLY-2493 Corrected description and added new reproducer, as the previous one was not correct.
Edited description: When trying to access public method/field of non-public class that implements public interface via EL I get "java.lang.IllegalAccessException: Class javax.el.BeanELResolver can not access a member of class X with modifiers "private"". E.g. accessing Collections.unmodifiableList(..) via EL will throw the exception, because #unmodifiableList returns non-public implementation of List interface. This is apparently caused by JDK-4071957 [1], but since that is opened for over 16 years, it should be probably worth it to implement a workaround. Workaround for this issue is setting setAccessible(true) on the method before invoking it, thus suppress Java access checking. I have attached a simple reproducer app as well as a stack trace of the exception. [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4071957
Farah Juma <fjuma> made a comment on jira JBEE-146 I've created the following PR: https://github.com/jboss/jboss-el-api_spec/pull/3
Shelly McGowan <smcgowan> made a comment on jira JBEE-146 Java EE 6 signature tests passed with jboss-el-api_2.2_spec-1.0.3.Final-SNAPSHOT. Will do a release.
Shelly McGowan <smcgowan> made a comment on jira JBEE-146 JBoss EL 2.2 Spec API, v1.0.3.Final has been released: https://repository.jboss.org/nexus/content/groups/public/org/jboss/spec/javax/el/jboss-el-api_2.2_spec/1.0.3.Final/
Shelly McGowan <smcgowan> made a comment on jira JBEE-146 Commit also merged to jboss-el-api_spec master: https://github.com/jboss/jboss-el-api_spec/commit/a3955731753487a2fbce5024a66c23bb2b28b63e
Farah Juma <fjuma> updated the status of jira JBEE-146 to Resolved
Fixed by upgrade for DR5
Tomaz Cerar <tomaz.cerar> updated the status of jira WFLY-2493 to Resolved
Verified in 6.3.0.DR5