0 Replies Latest reply on Oct 20, 2006 5:29 AM by Christine Zimmer

    errors when starting a new task and with ejbPassivate() meth

    Christine Zimmer Newbie

      Hello,

      I'm using the jbpm workflow engine within my Stateful Session Bean. My Processdefinition contains several tasks and subprocesses. When I start my clientapplication, it connects to the server and starts a new process. I'm using the Borland Application Server 6.6. But I have problems with my ejbPassivate() method, I get the following error:

      2006-10-12 10:53:37,377 INFO - ejbPassivate()
      2006-10-12 10:53:38,517 INFO - org.omg.CORBA.BAD_PARAM: Cannot write instance of gp.session.GPManager to stream [Reason:Could not cast classLoader of class org.jbpm.configuration.ObjectFactoryImpl to java.io.Serializable] vmcid: 0x0 minor code: 0 completed: No
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream.write_abstract_interface(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.rmi.CORBA.FieldWriter.writeFields(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeThisValue(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeValue(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.octets(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.state(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.value(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream.writeValueType(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream.write_value(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.rmi.CORBA.FieldWriter.writeFields(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeThisValue(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeValue(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.octets(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.state(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.value(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream.writeValueType(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.CDROutputStream.write_value(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.ejb.Global.writeObject(Global.java:384)
      2006-10-12 10:53:38,517 INFO - at com.inprise.ejb.StatefulSessionHome.etherealize(StatefulSessionHome.java:440)
      2006-10-12 10:53:38,517 INFO - at com.inprise.ejb.StatefulSessionHome$ServantActivator.etherealize(StatefulSessionHome.java:753)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.poa.POAImpl$Etherealizer.run(Unknown Source)
      2006-10-12 10:53:38,517 INFO - at com.inprise.vbroker.orb.ThreadPool$PoolWorker.run(Unknown Source)
      2006-10-12 10:53:38,517 ERROR - Error in StatefulSessionHome.ServantActivator.etherealize
      org.omg.CORBA.MARSHAL: Cannot write instance of gp.session.GPManager to stream [Reason:Could not cast classLoader of class org.jbpm.configuration.ObjectFactoryImpl to java.io.Serializable] vmcid: 0x0 minor code: 0 completed: No
       at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeValue(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.octets(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.state(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.value(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream.writeValueType(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream.write_value(Unknown Source)
       at com.inprise.vbroker.rmi.CORBA.FieldWriter.writeFields(Unknown Source)
       at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeThisValue(Unknown Source)
       at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeValue(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.octets(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.state(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.value(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream.writeValueType(Unknown Source)
       at com.inprise.vbroker.orb.CDROutputStream.write_value(Unknown Source)
       at com.inprise.ejb.Global.writeObject(Global.java:384)
       at com.inprise.ejb.StatefulSessionHome.etherealize(StatefulSessionHome.java:440)
       at com.inprise.ejb.StatefulSessionHome$ServantActivator.etherealize(StatefulSessionHome.java:753)
       at com.inprise.vbroker.poa.POAImpl$Etherealizer.run(Unknown Source)
       at com.inprise.vbroker.orb.ThreadPool$PoolWorker.run(Unknown Source)
      


      All my classes and all classes of jbpm are serializable, so I don?t know why I?m getting this error. And what is this classLoader of class org.jbpm.configuration.ObjectFactoryImpl?

      So I set the timeout for passivation to 0 seconds, that ejbPassivate() isn't called.
      But now I have another problem. When I start my application it works fine for the first time, but then I have to restart the server or I?m getting another error, when the workflow engine tries to start the first task of my subprocess:

      2006-10-12 11:04:37,671 ERROR - Could not synchronize database state with session
      org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#90439]
       at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1635)
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2208)
       at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
       at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:84)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
       at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
       at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:951)
       at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:109)
       at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:37)
       at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1203)
       at org.jbpm.db.TaskMgmtSession.findTaskInstancesByToken(TaskMgmtSession.java:133)
       at gp.EngineManager.getNextTaskInstance(EngineManager.java:164)
       at gp.EngineManager.starteTask(EngineManager.java:121)
       at gp.session.GPManager.starteTask(GPManager.java:62)
       at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at com.inprise.ejb.ConcreteMethod.invoke(ConcreteMethod.java:32)
       at com.inprise.ejb.EJBContext.invoke(EJBContext.java:209)
       at com.inprise.ejb.Dispatcher.doInvoke(Dispatcher.java:1529)
       at com.inprise.ejb.Dispatcher.invokeJACCSecurityCheck(Dispatcher.java:1137)
       at com.inprise.ejb.Dispatcher.invokeSecurityCheck(Dispatcher.java:1147)
       at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:892)
       at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:664)
       at com.inprise.ejb.EJBHome.dispatcherInvokeBeanMethod(EJBHome.java:85)
       at com.inprise.ejb.EJBHome$ComponentInterfaceMethodCache.invokeDispatcherMethod(EJBHome.java:1563)
       at com.inprise.ejb.EJBHome.invokeDispatcherMethod(EJBHome.java:63)
       at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:468)
       at gp.session.GPManagerRemotePOAInvokeHandler.starteTask(GPManagerRemotePOAInvokeHandler.java:135)
       at gp.session.GPManagerRemotePOAInvokeHandler.starteTask(GPManagerRemotePOAInvokeHandler.java:218)
       at gp.session.GPManagerRemotePOA._invoke(GPManagerRemotePOA.java:89)
       at gp.session.GPManagerRemotePOA._invoke(GPManagerRemotePOA.java:52)
       at com.inprise.vbroker.poa.POAImpl.invoke(Unknown Source)
       at com.inprise.vbroker.poa.ActivationRecord.invoke(Unknown Source)
       at com.inprise.vbroker.poa.ServerInterceptorManager$ARWrapper.invoke(Unknown Source)
       at com.inprise.vbroker.GIOP.GiopProtocolAdapter.doRequest(Unknown Source)
       at com.inprise.vbroker.IIOP.ServerProtocolAdapter.doRequest(Unknown Source)
       at com.inprise.vbroker.GIOP.GiopProtocolAdapter.dispatchMessage(Unknown Source)
       at com.inprise.vbroker.orb.TPDispatcherImpl$TPDispatcher.run(Unknown Source)
       at com.inprise.vbroker.orb.ThreadPool$PoolWorker.run(Unknown Source)
      2006-10-12 11:04:37,671 ERROR - org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#90439]
      2006-10-12 11:04:37,671 ERROR - Throwing System exception for the container-started transaction for method: public abstract boolean gp.session.GPManagerRemote.starteTask(java.util.List) throws java.rmi.RemoteException
      org.jbpm.JbpmException: couldn't get task instances by token '90439'
       at org.jbpm.db.TaskMgmtSession.findTaskInstancesByToken(TaskMgmtSession.java:139)
       at gp.EngineManager.getNextTaskInstance(EngineManager.java:164)
       at gp.EngineManager.starteTask(EngineManager.java:121)
       at gp.session.GPManager.starteTask(GPManager.java:62)
       at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at com.inprise.ejb.ConcreteMethod.invoke(ConcreteMethod.java:32)
       at com.inprise.ejb.EJBContext.invoke(EJBContext.java:209)
       at com.inprise.ejb.Dispatcher.doInvoke(Dispatcher.java:1529)
       at com.inprise.ejb.Dispatcher.invokeJACCSecurityCheck(Dispatcher.java:1137)
       at com.inprise.ejb.Dispatcher.invokeSecurityCheck(Dispatcher.java:1147)
       at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:892)
       at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:664)
       at com.inprise.ejb.EJBHome.dispatcherInvokeBeanMethod(EJBHome.java:85)
       at com.inprise.ejb.EJBHome$ComponentInterfaceMethodCache.invokeDispatcherMethod(EJBHome.java:1563)
       at com.inprise.ejb.EJBHome.invokeDispatcherMethod(EJBHome.java:63)
       at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:468)
       at gp.session.GPManagerRemotePOAInvokeHandler.starteTask(GPManagerRemotePOAInvokeHandler.java:135)
       at gp.session.GPManagerRemotePOAInvokeHandler.starteTask(GPManagerRemotePOAInvokeHandler.java:218)
       at gp.session.GPManagerRemotePOA._invoke(GPManagerRemotePOA.java:89)
       at gp.session.GPManagerRemotePOA._invoke(GPManagerRemotePOA.java:52)
       at com.inprise.vbroker.poa.POAImpl.invoke(Unknown Source)
       at com.inprise.vbroker.poa.ActivationRecord.invoke(Unknown Source)
       at com.inprise.vbroker.poa.ServerInterceptorManager$ARWrapper.invoke(Unknown Source)
       at com.inprise.vbroker.GIOP.GiopProtocolAdapter.doRequest(Unknown Source)
       at com.inprise.vbroker.IIOP.ServerProtocolAdapter.doRequest(Unknown Source)
       at com.inprise.vbroker.GIOP.GiopProtocolAdapter.dispatchMessage(Unknown Source)
       at com.inprise.vbroker.orb.TPDispatcherImpl$TPDispatcher.run(Unknown Source)
       at com.inprise.vbroker.orb.ThreadPool$PoolWorker.run(Unknown Source)
      Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#90439]
       at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1635)
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2208)
       at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
       at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:84)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
       at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
       at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:951)
       at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:109)
       at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:37)
       at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1203)
       at org.jbpm.db.TaskMgmtSession.findTaskInstancesByToken(TaskMgmtSession.java:133)
       ... 29 more
      


      The error occurs at the line:
      List taskInstances = taskMgmtSession.findTaskInstancesByToken(token.getId());

      I searched in the forum and with google, but I didn't find anyone with a similar problem.

      Thanks for your help.