3 Replies Latest reply on Jun 5, 2012 3:58 PM by hua zhong

    Too many problems

    hua zhong Newbie

      sometimes it's ok, sometimes not. sometimes fast, sometimes slow

       

       

      2012-06-05 22:54:57.858:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:88

      0    05/06 23:00:15,115[Thread-40] ERROR event.def.AbstractFlushingEventListener.performExecutions  - 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.persistence.processinstance.ProcessInstanceInfo#1]

          at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1782)

          at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425)

          at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325)

          at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625)

          at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)

          at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)

          at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

          at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)

          at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)

          at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)

          at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)

          at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)

          at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:193)

          at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)

          at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)

          at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:371)

          at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150)

          at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:219)

          at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler$1.run(GenericHTWorkItemHandler.java:187)

          at java.lang.Thread.run(Unknown Source)

      5    05/06 23:00:15,120[Thread-40] ERROR drools.persistence.SingleSessionCommandService.rollbackTransaction  - Could not commit session

      java.lang.RuntimeException: Unable to commit transaction

          at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:182)

          at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:371)

          at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150)

          at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:219)

          at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler$1.run(GenericHTWorkItemHandler.java:187)

          at java.lang.Thread.run(Unknown Source)

      Caused by: javax.persistence.OptimisticLockException: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.persistence.processinstance.ProcessInstanceInfo#1]

          at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:630)

          at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:588)

          at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513)

          at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)

          at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:193)

          at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)

          at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)

          ... 5 more

      Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.persistence.processinstance.ProcessInstanceInfo#1]

          at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1782)

          at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425)

          at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325)

          at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625)

          at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)

          at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)

          at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

          at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)

          at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)

          at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)

          at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)

          ... 9 more

      Exception in thread "Thread-40" java.lang.RuntimeException: Unable to commit transaction

          at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:182)

          at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:371)

          at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150)

          at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:219)

          at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler$1.run(GenericHTWorkItemHandler.java:187)

          at java.lang.Thread.run(Unknown Source)

      Caused by: javax.persistence.OptimisticLockException: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.persistence.processinstance.ProcessInstanceInfo#1]

          at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:630)

          at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:588)

          at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513)

          at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)

          at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:193)

          at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)

          at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)

          ... 5 more

      Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.persistence.processinstance.ProcessInstanceInfo#1]

          at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1782)

          at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425)

          at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325)

          at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625)

          at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)

          at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)

          at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

          at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)

          at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)

          at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)

          at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)

          ... 9 more

        • 1. Re: Too many problems
          hua zhong Newbie

          Task task = createTaskBasedOnWorkItemParams(workItem);

                  ContentData content = createTaskContentBasedOnWorkItemParams(workItem);

                  connect();

                  try {

                      getClient().addTask(task, content);

                      String userId = (String) workItem.getParameter("ActorId");

                      BusinessService.getWorkflowService().addProcessTask(task,userId,workId);

                  } catch (Exception e) {

                      if (action.equals(OnErrorAction.ABORT)) {

                          manager.abortWorkItem(workItem.getId());

                      } else if (action.equals(OnErrorAction.RETHROW)) {

                          if (e instanceof RuntimeException) {

                              throw (RuntimeException) e;

                          } else {

                              throw new RuntimeException(e);

                          }

                      } else if (action.equals(OnErrorAction.LOG)) {

                      }

                      e.printStackTrace();

                  }

           

           

           

           

           

          java.lang.RuntimeException: Task operation request timed out

              at org.jbpm.task.service.SyncTaskServiceWrapper.addTask(SyncTaskServiceWrapper.java:118)

              at com.sg.common.service.WorkHandler.executeWorkItem(WorkHandler.java:35)

              at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:55)

              at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:105)

              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)

              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)

              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)

              at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)

              at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)

              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)

              at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)

              at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:188)

              at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:303)

              at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:168)

              at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:138)

              at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1082)

              at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320)

              at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:120)

              at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:39)

              at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)

              at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367)

              at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)

              at com.sg.common.service.WorkflowService.startHumanProcess(WorkflowService.java:254)

              at com.sg.common.service.WorkflowService.startWorkProcess(WorkflowService.java:172)

              at com.sg.common.service.WorkService.createWork(WorkService.java:72)

              at com.sg.common.db.StandloneWorkSaveHandler.doSave(StandloneWorkSaveHandler.java:33)

              at com.sg.widget.dialog.SingleObjectEditorDialog.okPressed(SingleObjectEditorDialog.java:313)

              at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:457)

              at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:609)

              at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:191)

              at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:46)

              at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:186)

              at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:208)

              at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1145)

              at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1135)

              at org.eclipse.jface.window.Window.runEventLoop(Window.java:841)

              at org.eclipse.jface.window.Window.open(Window.java:817)

              at com.sg.cpm.myworks.actions.CreateWork.run(CreateWork.java:19)

              at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)

              at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)

              at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:575)

              at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:492)

              at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)

              at org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatchEvent(UntypedEventAdapter.java:646)

              at org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetSelected(UntypedEventAdapter.java:90)

              at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:191)

              at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:46)

              at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:186)

              at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:208)

              at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1145)

              at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1135)

              at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2733)

              at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)

              at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)

              at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:702)

              at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

              at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:685)

              at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)

              at com.sg.cpm.App.createUI(App.java:37)

              at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)

              at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:289)

              at java.lang.Thread.run(Unknown Source)

              at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)

          • 2. Re: Too many problems
            hua zhong Newbie

            and after some test, jboss crashed. It's hard to understand.

             

             

            java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.teg/LATEST/

                at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:705)

                at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:45)

                at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)

                at com.sg.bpm.service.BPMService.registeResource(BPMService.java:65)

                at com.sg.bpm.service.BPMService.getKnowledgeBase(BPMService.java:48)

                at com.sg.common.service.WorkflowService.getCurrentSiteKnowledgebase(WorkflowService.java:51)

                at com.sg.common.service.WorkflowService.getUserMapFromWorkData(WorkflowService.java:189)

                at com.sg.common.service.WorkflowService.startWorkProcess(WorkflowService.java:170)

                at com.sg.common.service.WorkService.createWork(WorkService.java:72)

                at com.sg.common.db.StandloneWorkSaveHandler.doSave(StandloneWorkSaveHandler.java:33)

                at com.sg.widget.dialog.SingleObjectEditorDialog.okPressed(SingleObjectEditorDialog.java:313)

                at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:457)

                at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:609)

                at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:191)

                at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:46)

                at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:186)

                at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:208)

                at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1145)

                at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1135)

                at org.eclipse.jface.window.Window.runEventLoop(Window.java:841)

                at org.eclipse.jface.window.Window.open(Window.java:817)

                at com.sg.cpm.myworks.actions.CreateWork.run(CreateWork.java:19)

                at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)

                at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)

                at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:575)

                at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:492)

                at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)

                at org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatchEvent(UntypedEventAdapter.java:646)

                at org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetSelected(UntypedEventAdapter.java:90)

                at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:191)

                at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:46)

                at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:186)

                at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:208)

                at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1145)

                at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1135)

                at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2733)

                at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)

                at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)

                at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:702)

                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

                at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:685)

                at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)

                at com.sg.cpm.App.createUI(App.java:37)

                at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)

                at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:289)

                at java.lang.Thread.run(Unknown Source)

                at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)

            Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.teg/LATEST/

                at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

                at org.drools.io.impl.UrlResource.grabStream(UrlResource.java:210)

                at org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:146)

                at org.drools.compiler.PackageBuilder.addPackageFromInputStream(PackageBuilder.java:780)

                at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692)

                ... 46 more

            • 3. Re: Too many problems
              hua zhong Newbie

              I try to use LocalHumanTaskService,

              WorkHandler handler = new WorkHandler(ksession ,LocalHumanTaskService.getTaskService(ksession));

                      ksession.getWorkItemManager().registerWorkItemHandler("Human Task", handler);

                      if (params.isEmpty()) {

                          return ksession.startProcess(processId);

                      } else {

                          return ksession.startProcess(processId, params);

                      }

              but I got new exception:

              Cannot find named query UnescalatedDeadlines...

              but in the Taskorm.xml, it has!

              I think the reason is that service needs use only one persistence-unit.

               

              After that, I combinated the human task persistence and processinstance. It solved.

               

              It is very strange!