NullpointerException when execute a merge


How can we analyze the cause of an "Unexpected internal exception"?


We create an object tree that is persisted with "merge()". Then we want to persist “merge()” an new object of a different type.


[we use ObjectDb 2.6.0_3]

Caused by: com.objectdb.o.InternalException: Unexpected internal exception
at com.objectdb.o.JPE.h(
at com.objectdb.o.ERR.f(
at com.objectdb.o.OBC.onObjectDBError(
at com.objectdb.jpa.EMImpl.merge(
at com.btc.ep.dal.persist.impl.PersistenceService.update(
at com.btc.ep.base.dal.internal.BaseRepositoryImpl.update(
at com.btc.ep.base.dal.internal.MessageRepositoryImpl.addMessage(
at com.btc.ep.architecture.targetlink.xmlbypass.ui.TargetLinkXmlBypassHandler.importSimulinkArchitectureXml(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(
... 30 more
Caused by: java.lang.NullPointerException
at com.objectdb.o.MST.aY(
at com.objectdb.o.MST.U9(
at com.objectdb.o.WRA.U9(
at com.objectdb.o.LDR.F(
at com.objectdb.o.LDR.E(
at com.objectdb.o.OBC.UO(
at com.objectdb.o.OBC.aN(
at com.objectdb.o.EMR.h(
at com.objectdb.o.TVS.g(
at com.objectdb.o.TVS.g(
at com.objectdb.o.EMR.q(
at com.objectdb.jpa.EMImpl.merge(
... 43 more


But if we use enhanced classes, we do not get this error.

During development, we work with non-enhanced classes.

Have you an idea what is the cause of this problem?
We can not reproduce this problem in a small example. It appears only in this constellation in our application.


Thank you for this report. The stack trace indicates an exception on an attempt to merge objects with PK before persisting the first instance of this entity type to the database.

Please try build 2.6.0_04 that includes a fix.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Thank You, now it works.

Post Reply

To post a reply and/or subscribe to update notifications - please login