Bug 229 : ClassCastException in BeanDescriptor.createCopy(BeanDescriptor.java:527)
Priority 
Medium
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.5.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
03/03/2010
Updated 
03/03/2010
Type 
Bug
 
Attachments 
No attachments

java.lang.ClassCastException: com.avaje.tests.model.basic.Customer
at com.avaje.ebean.server.deploy.BeanDescriptor.createCopy(BeanDescriptor.java:527)
at com.avaje.ebean.server.core.OrmQueryRequest.getFromPersistenceContextOrCache(OrmQueryRequest.java:447)
at com.avaje.ebean.server.core.DefaultServer.findId(DefaultServer.java:1110)
at com.avaje.ebean.server.core.DefaultServer.findUnique(DefaultServer.java:1136)
at com.avaje.ebean.server.querydefn.DefaultOrmQuery.findUnique(DefaultOrmQuery.java:777)
at com.avaje.tests.cache.TestCacheJoin.test(TestCacheJoin.java:36)
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.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

 
Rob 03 Mar 07:54
This occurs when not using enhancement ... and using caching ... with readonly = false

To reproduce you need:
- use subclassing (not enhancement)
- using caching and returning objects with readonly = false

Refer to test: TestCacheJoin

woResponse

Upload a file