Hello,
I was creating dynamic object to store data inside database. I am using javassist API to create dynamic class. Here i have written some code which is create dynamic class as well as object. Class and object successfully created. And insert data also now problem is only once object is created and insert data only first time. when i am execute is it next time it throws following exception.:
Exception in thread "main" [ObjectDB 2.7.5] javax.persistence.RollbackException Failed to commit transaction: Failed to get reference value of field field DClass.Field_1 using enhanced method (error 613) at com.objectdb.jpa.EMImpl.commit(EMImpl.java:289) at packone.DMain.main(DMain.java:53) Caused by: javax.persistence.PersistenceException: com.objectdb.o.UserException: Failed to get reference value of field field DClass.Field_1 using enhanced method at com.objectdb.o._PersistenceException.a(_PersistenceException.java:47) at com.objectdb.o.JPE.d(JPE.java:147) at com.objectdb.o.JPE.d(JPE.java:80) ... 4 more Caused by: com.objectdb.o.UserException: Failed to get reference value of field field DClass.Field_1 using enhanced method at com.objectdb.o.MSG.a(MSG.java:77) at com.objectdb.o.UMR.s(UMR.java:936) at com.objectdb.o.UMR.g(UMR.java:721) at com.objectdb.o.ENT.j(ENT.java:458) at com.objectdb.o.ENT.j(ENT.java:388) at com.objectdb.o.STA.L(STA.java:875) at com.objectdb.o.STM.j(STM.java:598) at com.objectdb.o.OBM.aC(OBM.java:1086) at com.objectdb.o.OBM.aS(OBM.java:867) at com.objectdb.o.OBM.aG(OBM.java:755) at com.objectdb.jpa.EMImpl.commit(EMImpl.java:286) ... 1 more Caused by: java.lang.ClassCastException: DClass cannot be cast to com.objectdb.spi.TrackableUserType at com.objectdb.o.UMR.h(UMR.java:750) at com.objectdb.o.UMR.g(UMR.java:715) ... 9 more
Thank you.