[jboss-jira] [JBoss JIRA] Assigned: (JBRULES-3140) NullPointerException thrown on JPA synchronization.afterCompletion() due to clearProcessInstances()

Mark Proctor (JIRA) jira-events at lists.jboss.org
Thu Sep 29 02:35:26 EDT 2011


     [ https://issues.jboss.org/browse/JBRULES-3140?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list