[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-577) IllegalArgumentException when using @Proxy and trying to delete a loaded but proxied class

Emmanuel Bernard (JIRA) noreply at atlassian.com
Wed Oct 13 09:43:18 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38718#action_38718 ] 

Emmanuel Bernard commented on HSEARCH-577:
------------------------------------------

I've spend some time on the issue. The problem is that we enlist the required Method (getter in this case) from the actual physical class and not from the @Proxy.proxyClass. When an instance was initially lazy and subsequently loaded, the actually type is HibernateProxy_Javassistxyz and not the actual physical class (say Person).

When trying to access the getter, the invoke operation fails.

The solution is not trivial and would involve finding the referencing getter from the @Proxy.proxyClass class and use this one (exclusively or as a backup?). That's a lot of work though for a very edge case.

I don't really have the necessary cycles to work on it but if someone from the community can step up and provide a solution, I will try and assist.

The unit test is committed and available here http://github.com/emmanuelbernard/hibernate-search/commit/3d6b1243729b139c0659eddee4cf53a9a4126c4d
The work has to be done in AbstractDocumentBuilder

> IllegalArgumentException when using @Proxy and trying to delete a loaded but proxied class
> ------------------------------------------------------------------------------------------
>
>                 Key: HSEARCH-577
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-577
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 3.2.1
>         Environment: Hibernate Search 3.2.1
> Hibernate Core 3.5.2
>            Reporter: Tom Kuo
>            Assignee: Emmanuel Bernard
>             Fix For: 3.2.2, 3.3.0.Beta2
>
>         Attachments: ProxyTestCase.zip
>
>
> I'm receiving an IllegalArgumentException while trying to delete an entity that is a part of a @ContainedIn/@IndexedEmbedded relationship.  I created a testcase to reproduce the error i'm seeing.  The original issue that prompted this was actually a ClassCastException as discussed in this thread
> https://forum.hibernate.org/viewtopic.php?f=9&t=1006381
> however in creating the test case i was unable to replicate that particular error, but ran into this one, which seemed similar.

-- 
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