IllegalAccessException if a default-method is called in Lazy-Loaded Proxy 
objects
---------------------------------------------------------------------------------

                 Key: IBATIS-595
                 URL: https://issues.apache.org/jira/browse/IBATIS-595
             Project: iBatis for Java
          Issue Type: Bug
          Components: SQL Maps
    Affects Versions: 2.3.4
            Reporter: Stefan Gmeiner
         Attachments: lazy-loader.patch

We are using the iBatis enhanced (cglib) proxy for lazy loading our bean
references.  One of these returned-proxied object is accessing a
default-modifier method of another class in the same package. The code compiles
without error but running it throws an IllegalAccessException thrown from the
CGLIB-Proxy as it tries to invoke a non-public (default or protected) method
from a different package.

I wrote a test case for this problem (see attached patch).

There is a solution (at least for default-modifier methods) for this problem
using cglib LazyLoader callbacks. This is a replacement for the invocation 
handler
which also has the advantage of increasing the performance of proxied objects
as no methods are intercepted. This solution is contained in the attached
patch. Unfortunately cglib handles protected methods differently to default so
this solutions does not work with protected method calls.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to