Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-5824

Aborting HT after Ad Hoc Completion Condition throws SessionNotFoundException

    Details

      Description

      I have an ad-hoc subprocess in which a HT gets activated. When the sub process gets completed, and after that the full process gets completed, while the HT is still active, the engine wants to abort the LocalHTWorkItemHandler. This results in a SessionNotFound Exception:

      org.jbpm.workflow.instance.WorkflowRuntimeException: [jbpm-abort-ht-issue.ad-hoc-abort-ht:1 - Complete:5] -- No session found for context 1
      	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:179)
      	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:366)
      	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:325)
      	at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:61)
      	at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:57)
      	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:173)
      	at org.jbpm.workflow.instance.node.DynamicNodeInstance.signalEvent(DynamicNodeInstance.java:95)
      	at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:526)
      	at org.drools.core.command.runtime.process.SignalEventCommand.execute(SignalEventCommand.java:125)
      	at org.drools.core.command.runtime.process.SignalEventCommand.execute(SignalEventCommand.java:39)
      	at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      	at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:604)
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      	at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82)
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      	at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
      	at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:397)
      	at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.signalEvent(CommandBasedStatefulKnowledgeSession.java:243)
      	at org.jbpm.ddoyle.reproducer.AdHocAbortHtTest.testCompleteProcess(AdHocAbortHtTest.java:27)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
      Caused by: org.kie.internal.runtime.manager.SessionNotFoundException: No session found for context 1
      	at org.jbpm.runtime.manager.impl.PerProcessInstanceRuntimeManager$PerProcessInstanceInitializer.initKieSession(PerProcessInstanceRuntimeManager.java:535)
      	at org.jbpm.runtime.manager.impl.RuntimeEngineImpl.getKieSession(RuntimeEngineImpl.java:70)
      	at org.jbpm.runtime.manager.impl.AbstractRuntimeManager.registerDisposeCallback(AbstractRuntimeManager.java:154)
      	at org.jbpm.runtime.manager.impl.PerProcessInstanceRuntimeManager$PerProcessInstanceInitializer.initTaskService(PerProcessInstanceRuntimeManager.java:566)
      	at org.jbpm.runtime.manager.impl.RuntimeEngineImpl.getTaskService(RuntimeEngineImpl.java:82)
      	at org.jbpm.services.task.wih.LocalHTWorkItemHandler.abortWorkItem(LocalHTWorkItemHandler.java:100)
      	at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalAbortWorkItem(JPAWorkItemManager.java:106)
      	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.cancel(WorkItemNodeInstance.java:334)
      	at org.jbpm.workflow.instance.node.CompositeNodeInstance.triggerCompleted(CompositeNodeInstance.java:175)
      	at org.jbpm.workflow.instance.node.DynamicNodeInstance.triggerCompleted(DynamicNodeInstance.java:86)
      	at org.jbpm.workflow.instance.node.DynamicNodeInstance.nodeInstanceCompleted(DynamicNodeInstance.java:78)
      	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:309)
      	at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:61)
      	at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:57)
      	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:173)
      	... 50 more
      

      Note that this is a regression in 6.5.0.Final-redhat-2 and master (7.0.0-SNAPSHOT). The test runs fine on 6.5.0.Final.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swiderski.maciej Maciej Swiderski
                Reporter:
                McCloud Duncan Doyle
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: