Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Won't Fix
-
1.6
-
None
-
None
Description
I've attached an example script that demonstrates an issue with Groovy callsite caching when combined with Hibernate proxy usage. Accessing an association of an entity that is lazily loaded with a Hibernate proxy results in an IllegalArgumentException:
java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
This has is causing this issue in Grails: http://jira.codehaus.org/browse/GRAILS-4230