ObjectDB ObjectDB

Issue #368: NullPointer running multiple client against server

Type: Bug ReoprtVersion: 2.2.7Priority: NormalStatus: FixedReplies: 2


I'm running objectdb in server mode, config as it comes out of the box.

In this case the database is being used as a queue with multiple seperate processes, each with multiple threads, writing messages. The message is split into a lightweight metadata message to allow fast searching and a more heavy weight data message. The put methods are shown below. The message is made up of an id, insert-time, priority and the payload is a large string.

public void put(Message msg) {
  ObjectDbMessage objectDbMessage = msg instanceof ObjectDbMessage
           ? (ObjectDbMessage)msg
           : ObjectDbMessage.CreateObjectDbMessage(msg);
        put(_dataEmf, objectDbMessage);
        synchronized(_queueEmf) {
            put(_queueEmf, objectDbMessage.getMessageMetadata());
public void put(EntityManagerFactory emf, Object obj) {
   EntityManager em = emf.createEntityManager();
   try {
   } catch(Exception e) {
    throw new ApplicationException("Error putting message on objectdb queue", e);
   } finally {

I've tested this extensively in embedded mode and it works fine with many writers and readers. However, in server mode I'm occasionally seeing the error below. It doesn't occur frequently and I've been unable to recreate with a dedicated test as yet (I will post here if I do). I am worried about potentially losing messages though so I was hoping you might be able to shed some light on what is happening.

rbccm.felix.framework.ApplicationException: Error putting message on objectdb queue
at rbccm.felix.objectdb.messaging.ObjectDbMessagePipe.put(Unknown Source)
at rbccm.felix.objectdb.messaging.ObjectDbMessagePipe.put(Unknown Source)
at rbccm.felix.objectdb.messaging.ObjectDbMessagePipe.put(Unknown Source)
at rbccm.felix.gridservice.workflow.WorkflowAdminCallbackService.workflowCallback(Unknown Source)
at rbccm.digest.workflow.execution.WorkflowRunner.workflowCallback(Unknown Source)
at rbccm.digest.workflow.execution.WorkflowRunner.startWorkflow(Unknown Source)
at rbccm.felix.gridservice.workflow.WorkflowService.process(Unknown Source)
at rbccm.felix.gridservice.workflow.WorkflowService.process(Unknown Source)
at rbccm.felix.gridservice.workflow.WorkflowService.process(Unknown Source)
at rbccm.felix.framework.service.ServiceRunner.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)
Caused by: com.objectdb.o._RollbackException: Failed to commit transaction: $1
at com.objectdb.o.JPE.g(JPE.java:89)
at com.objectdb.o.ERR.f(ERR.java:59)
at com.objectdb.o.OBC.onObjectDBError(OBC.java:1443)
at com.objectdb.jpa.EMImpl.commit(EMImpl.java:277)
... 11 more
Caused by: java.lang.NullPointerException
at com.objectdb.o.TVR.c(TVR.java:67)
at com.objectdb.o.TVR.b(TVR.java:51)
at com.objectdb.o.TYM.ac(TYM.java:517)
at com.objectdb.o.TYM.aa(TYM.java:441)
at com.objectdb.o.TYM.am(TYM.java:760)
at com.objectdb.o.TYM.aq(TYM.java:845)
at com.objectdb.o.EPR.Um(EPR.java:77)
at com.objectdb.o.UML.w(UML.java:544)
at com.objectdb.o.MMM.ad(MMM.java:975)
at com.objectdb.o.UTY.visitRefs(UTY.java:1143)
at com.objectdb.o.TVS.j(TVS.java:169)
at com.objectdb.o.TVS.cascade(TVS.java:146)
at com.objectdb.o.STA.Q(STA.java:476)
at com.objectdb.o.STM.D(STM.java:393)
at com.objectdb.o.OBM.bH(OBM.java:884)
at com.objectdb.jdo.PMImpl.bH(PMImpl.java:2186)
at com.objectdb.o.OBM.bG(OBM.java:800)
at com.objectdb.o.OBM.bE(OBM.java:715)
at com.objectdb.jpa.EMImpl.commit(EMImpl.java:274)
... 11 more

Thanks for your help



According to the stack trace - it doesn't look as anything serious, just an incomplete check of a new type.

It seems as something that may happen in client-server in one of the clients - if the database is new and that client gets to know the types in the schema in some specific order.

Please try version 2.2.8 that may fix it.

ObjectDB Support

I deployed the new build and haven't seen the error since so that seems to have fixed it.




To post on this website please sign in.