Bug 1029387
Summary: | WFLY-2493 EL cannot access public methods/fields of non-public classes | |||
---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Jonáš Trantina <jtrantin> | |
Component: | JSF | Assignee: | Farah Juma <fjuma> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Matous Jobanek <mjobanek> | |
Severity: | unspecified | Docs Contact: | Russell Dickenson <rdickens> | |
Priority: | unspecified | |||
Version: | 6.1.0 | CC: | aneelica, fjuma, kkhan, maschmid, rsmeral, smumford, ssilvert | |
Target Milestone: | DR5 | |||
Target Release: | EAP 6.3.0 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: |
In previous versions of JBoss EAP 6 the BeanELResolver did not try to override Method.invoke access control to access public methods or fields of non-public classes.
This caused issues when trying to access the public method or field of a non-public class via Expression Language (EL) the following error message resulted:
----
"java.lang.IllegalAccessException: Class javax.el.BeanELResolver can not access a member of class X with modifiers "private"
----
This issue has been resolved by calling setAccessible(true) as appropriate in the EL implementation. Public methods or fields of non-public class are now accessile via EL
|
Story Points: | --- | |
Clone Of: | ||||
: | 1076320 (view as bug list) | Environment: | ||
Last Closed: | 2014-07-29 14:39:40 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1076061, 1076320 |
Description
Jonáš Trantina
2013-11-12 10:26:32 UTC
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 |