[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-3140) NullPointerException thrown on JPA synchronization.afterCompletion() due to clearProcessInstances()
Kris Verlaenen (JIRA)
jira-events at lists.jboss.org
Thu Sep 29 06:14:26 EDT 2011
[ https://issues.jboss.org/browse/JBRULES-3140?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kris Verlaenen resolved JBRULES-3140.
-------------------------------------
Fix Version/s: 5.3.0.Final
Resolution: Done
> 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
> Fix For: 5.3.0.Final
>
>
> 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
More information about the jboss-jira
mailing list