]
Mark Proctor reassigned JBRULES-3140:
-------------------------------------
Assignee: Kris Verlaenen (was: Mark Proctor)
NullPointerException thrown on JPA synchronization.afterCompletion()
due to clearProcessInstances()
---------------------------------------------------------------------------------------------------
Key: JBRULES-3140
URL:
https://issues.jboss.org/browse/JBRULES-3140
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 5.2.0.Final
Reporter: Nick Bruno
Assignee: Kris Verlaenen
Labels: patch
In
org.drools.persistence.SingleSessionCommandService$SynchronizationImpl.afterCompletion(),
the following generates a NullPointerException when no processes are implemented.
{noformat}if ( ksession != null ) {
((InternalKnowledgeRuntime) ksession).getProcessRuntime().clearProcessInstances();
// NullPointerException
((JPAWorkItemManager) ksession.getWorkItemManager()).clearWorkItems();
}
{noformat}
The fix is to grab the InternalProcessRuntime to a local variable and test if it is null
before calling clearProcessInstances(), as so:
{noformat}InternalProcessRuntime ipr = ((InternalKnowledgeRuntime)
ksession).getProcessRuntime();
if( ipr != null) {
ipr.clearProcessInstances();
}{noformat}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: