[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2355) CGLIBLazyInitializer can not access a public member if parent class is not public

Serge Bogatyrjov (JIRA) noreply at atlassian.com
Mon Mar 26 18:15:04 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Serge Bogatyrjov updated HHH-2355:
----------------------------------

    Attachment: test.tar.gz

A test case demonstrates the bug nature and proposes a simple solution.

> CGLIBLazyInitializer can not access a public member if parent class is not public
> ---------------------------------------------------------------------------------
>
>                 Key: HHH-2355
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2355
>             Project: Hibernate3
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Daniel Beland
>         Attachments: test.tar.gz
>
>
> In hibernate 3.2.1, CGLIBLazyInitializer cannot acces a public method if it has been inherited from a parent class that is not public.
> Let's say we have a class A, modifier = default (package) with a public method getName()  (and setName(String name)). 
> Then I create a public class B that extends A.
> in my code I can retrieve B from the database:
> B b = session.load(B.class, new Integer(1), LockMode.NONE);
> I receive b with all the values set correctly (So at this point, Hibernate was able to use the method setName() correctly).
> In my code if I then try to use b.getName(), I receive and error:
> java.lang.IllegalAccessException-->Class org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer can not access a member of class A with modifiers "public"
> But I am not trying to access A.getName(), but B.getName() (which is a public method in a public class).
> This was working perfectly with Hibernate 2.1.7c and 3.1.3.
> The full information about my problem can be found here: http://forum.hibernate.org/viewtopic.php?t=969453

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list