You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Stefan Gmeiner (JIRA)" <ib...@incubator.apache.org> on 2009/05/06 16:11:30 UTC

[jira] Created: (IBATIS-595) IllegalAccessException if a default-method is called in Lazy-Loaded Proxy objects

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.


[jira] Commented: (IBATIS-595) IllegalAccessException if a default-method is called in Lazy-Loaded Proxy objects

Posted by "Stefan Gmeiner (JIRA)" <ib...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/IBATIS-595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710629#action_12710629 ] 

Stefan Gmeiner commented on IBATIS-595:
---------------------------------------

Kai,
Yes, I forgot to add the test in the patch. I attached it now as lazy-loader-test.patch.

> 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
>             Fix For: 2.3.5
>
>         Attachments: lazy-loader-test.patch, 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.


[jira] Commented: (IBATIS-595) IllegalAccessException if a default-method is called in Lazy-Loaded Proxy objects

Posted by "Kai Grabfelder (JIRA)" <ib...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/IBATIS-595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710456#action_12710456 ] 

Kai Grabfelder commented on IBATIS-595:
---------------------------------------

@Stefan: could it be that you forgot the test? Or is the test contained in your patches to IBATIS-596?

> 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
>             Fix For: 2.3.5
>
>         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.