Bug 1304508 - [GSS](6.2.z)NPE exception is thrown when using jbpm kie ProcessService to issue signal event
Summary: [GSS](6.2.z)NPE exception is thrown when using jbpm kie ProcessService to iss...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: CR1
: 6.2.2
Assignee: Alessandro Lazarotti
QA Contact: Radovan Synek
URL:
Whiteboard:
Depends On: 1304496
Blocks: 1309326 1311163
TreeView+ depends on / blocked
 
Reported: 2016-02-03 20:58 UTC by Alessandro Lazarotti
Modified: 2020-03-27 20:10 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1304496
Environment:
Last Closed: 2020-03-27 20:10:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2263431 0 None None None 2016-04-19 12:39:34 UTC

Description Alessandro Lazarotti 2016-02-03 20:58:41 UTC
+++ This bug was initially created as a clone of Bug #1304496 +++

A NPE exeception is thrown when the following code is used to issue the signal event:
 processService.signalProcessInstance(pi.getId(), ROUTING_EXCEPTION, null);

The stack trace is:

Caused by: java.lang.NullPointerException
	at org.kie.spring.persistence.AbstractKieSpringJpaManager$EmHolderDelegateInvocationHandler.invoke(AbstractKieSpringJpaManager.java:141) [kie-spring-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at com.sun.proxy.$Proxy67.joinTransaction(Unknown Source)
	at org.jbpm.process.audit.JPAWorkingMemoryDbLogger.joinTransaction(JPAWorkingMemoryDbLogger.java:246) [jbpm-audit-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.jbpm.process.audit.JPAWorkingMemoryDbLogger.persist(JPAWorkingMemoryDbLogger.java:195) [jbpm-audit-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.jbpm.process.audit.JPAWorkingMemoryDbLogger.afterNodeLeft(JPAWorkingMemoryDbLogger.java:120) [jbpm-audit-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.drools.core.event.ProcessEventSupport.fireAfterNodeLeft(ProcessEventSupport.java:124) [drools-core-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:375) [jbpm-flow-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:325) [jbpm-flow-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:61) [jbpm-flow-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:57) [jbpm-flow-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:173) [jbpm-flow-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	... 50 more


The problem is caused by the current implementation in org.jbpm.kie.services.impl.ProcessServiceImpl.
Note that it disposes the runtime engine after sending the signal event:
      try {
           ksession.signalEvent(signalName, event, processInstanceId);
       } finally {
       	disposeRuntimeEngine(manager, engine);
       }

So the disposeRuntimeEngine needs to be fixed actually on runtime manager level to handle it properly for all possible cases.

--- Additional comment from JBoss Product and Program Management on 2016-02-03 15:10:08 EST ---

Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 2 Maciej Swiderski 2016-02-25 10:52:47 UTC
fix back ported to 6.3.x

jbpm
6.3.x:
https://github.com/droolsjbpm/jbpm/commit/6655d212b954bcd576e90ce4ec686a6c03068d35

Comment 3 Tomas Livora 2016-03-08 11:45:05 UTC
Verified on BPM Suite 6.2.2 CR1

Comment 4 Amana 2016-04-06 11:11:20 UTC
Hi all,

Is there any chance to backport it to 6.1? It is a customer requirement.


Note You need to log in before you can comment on or make changes to this bug.