Felix, rollback exception, error 613

#1

Hello, i have a problem under felix osgi environment. I tested both 2.6.0 & 2.7.5 versions.

I can begin, persist and commit once, but not twice; even after framework restart. I need to delete my database file.

I joined my jee/bndtools workspace. I needed to change the classloader to properly get objectdb working under my osgi framework.

I have absolutely not any error under non-osgi environment.

 

Sorry for the two different messy stack traces :

[ERROR] Exception while processing request to /example/
[ObjectDB 2.7.5] javax.persistence.RollbackException
Failed to commit transaction: Failed to get reference value of field field db.Point.x using enhanced method (error 613)
    at com.objectdb.jpa.EMImpl.commit(EMImpl.java:289)
    at db.Activator.storePoints(Activator.java:34)
    at FelixProject.ExampleServlet.doGet(ExampleServlet.java:21)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85)
    at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79)
    at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:128)
    at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:534)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.persistence.PersistenceException: com.objectdb.o.UserException: Failed to get reference value of field field db.Point.x 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)
    ... 34 more
Caused by: com.objectdb.o.UserException: Failed to get reference value of field field db.Point.x 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)
    ... 31 more
Caused by: java.lang.ClassCastException: db.Point 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)
    ... 39 more

 

! Failed to start bundle FelixProject-0.0.0.201806081311, exception activator error Failed to commit transaction: Failed to get reference value of field field db.Point.x using enhanced method from: com.objectdb.o.JPE:d#91 org.osgi.framework.BundleException: Activator start error in bundle FelixProject [1]. at org.apache.felix.framework.Felix.activateBundle(Felix.java:2290) at org.apache.felix.framework.Felix.startBundle(Felix.java:2146) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) at aQute.launcher.Launcher.startBundles(Launcher.java:517) at aQute.launcher.Launcher.activate(Launcher.java:423) at aQute.launcher.Launcher.run(Launcher.java:301) at aQute.launcher.Launcher.main(Launcher.java:147) Caused by: com.objectdb.o._RollbackException: Failed to commit transaction: Failed to get reference value of field field db.Point.x using enhanced method at com.objectdb.o.JPE.d(JPE.java:91) at com.objectdb.o.ERR.h(ERR.java:56) at com.objectdb.o.OBC.onObjectDBError(OBC.java:1582) at com.objectdb.jpa.EMImpl.commit(EMImpl.java:289) at db.Activator.storePoints(Activator.java:34) at db.Activator.start(Activator.java:18) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2240) ... 6 more Caused by: javax.persistence.PersistenceException: com.objectdb.o.UserException: Failed to get reference value of field field db.Point.x 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) ... 13 more Caused by: com.objectdb.o.UserException: Failed to get reference value of field field db.Point.x 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) ... 10 more Caused by: java.lang.ClassCastException: db.Point 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) ... 18 more

#2

To solve the class loader conflict you have to set the current thread class loader to the class loader that loads your entity classes, before accessing ObjectDB:

Thread.currentThread().setContextClassLoader(MyEntity.class.getClassLoader());
ObjectDB Support

Reply