You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/08/28 09:58:05 UTC

DO NOT REPLY [Bug 51730] New: Exception while trying to use "is" prefixed boolean property inherited from package private base class

https://issues.apache.org/bugzilla/show_bug.cgi?id=51730

             Bug #: 51730
           Summary: Exception while trying to use "is" prefixed boolean
                    property inherited from package private base class
           Product: Tomcat 7
           Version: 7.0.20
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Servlet & JSP API
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: irina@marudina.net
    Classification: Unclassified


Created attachment 27439
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27439
Sample project to reproduce the issue

I have a bean which inherits an "is" prefixed boolean property from a package
private base class. I can get the property value using <jsp:getProperty>. But
if I try to get the value using expression language, I have the following
exception:


SEVERE: Servlet.service() for servlet [jsp] in context with path
[/JSPBeansTest] threw exception [javax.el.ELException:
java.lang.IllegalAccessException: Class javax.el.BeanELResolver can not access
a member of class user.UserBeanBase with modifiers "public"] with root cause
java.lang.IllegalAccessException: Class javax.el.BeanELResolver can not access
a member of class user.UserBeanBase with modifiers "public"
    at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at javax.el.BeanELResolver.getValue(BeanELResolver.java:87)
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67)
    at org.apache.el.parser.AstValue.getValue(AstValue.java:169)
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
    at
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:985)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:138)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279)
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
    at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

If the boolean property is in the base class and is prefixed with "get" its
value is retrieved without error.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51730] Exception while trying to use "is" prefixed boolean property inherited from package private base class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51730

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Mark Thomas <ma...@apache.org> 2011-08-29 18:19:06 UTC ---
This looks like a JVM bug. You'll need to produce a simple test case (that
doesn't use Tomcat) and report it to Oracle. Trying to call the isAllowedBase()
method using reflection should be enough to trigger the issue.

That the problem goes away when the method is renamed from isXXX to getXXX
strongly suggests a JVM bug. I have traced the differences in behaviour to
sun.reflect.Reflection.getClassAccessFlags().

I am afraid there is nothing we can do in Tomcat to address this.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51730] Exception while trying to use "is" prefixed boolean property inherited from package private base class

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51730

--- Comment #2 from Irina Marudina <ir...@marudina.net> 2011-08-31 14:38:52 UTC ---
It seems to be an issue in the java.beans.Introspector. I have produced a
simple test program and reported the bug to Oracle:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7084904

Actually the reason to think it is a problem in Tomcat is because I tested with
Apache Common BeanUtils and it worked fine. But it seems the reason is that
they have applied a special workaround as explained here:

---
Known Limitations
Accessing Public Methods In A Default Access Superclass

There is an issue when invoking public methods contained in a default access
superclass. Reflection locates these methods fine and correctly assigns them as
public. However, an IllegalAccessException is thrown if the method is invoked.

MethodUtils contains a workaround for this situation. It will attempt to call
setAccessible on this method. If this call succeeds, then the method can be
invoked as normal. This call will only succeed when the application has
sufficient security privilages. If this call fails then a warning will be
logged and the method may fail.
---

Source: 
http://commons.apache.org/beanutils/api/org/apache/commons/beanutils/MethodUtils.html

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org