[
https://issues.jboss.org/browse/JBRULES-3140?page=com.atlassian.jira.plug...
]
Nick Bruno updated JBRULES-3140:
--------------------------------
Summary: NullPointerException thrown on JPA synchronization.afterCompletion() due to
clearProcessInstances() (was: NullPointerException thrown on JPA
synchronization.afterCompletion() clearProcessInstances())
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: Mark Proctor
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:
http://www.atlassian.com/software/jira