[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2729) NullPointerException from CompositeMaxDurationTimer.createTrigger

Will Lauer (JIRA) jira-events at lists.jboss.org
Thu Oct 14 16:37:40 EDT 2010


    [ https://jira.jboss.org/browse/JBRULES-2729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557181#action_12557181 ] 

Will Lauer commented on JBRULES-2729:
-------------------------------------

I'm not sure I really understand the subtleties of the code yet, but it looks like the solution for this is probably pretty simple. Instead of CompositeMaxDurationTimer.createTrigger being defined as

    public Trigger createTrigger(long timestamp,
                                 String[] calendarNames,
                                 Calendars calendars) {
        return new CompositeMaxDurationTrigger( new Date( getMaxDuration() + timestamp ),
                                                timer.createTrigger( timestamp,
                                                                     calendarNames,
                                                                     calendars ),
                                                calendarNames,
                                                calendars );
    }

it should be instead modified, replacing the timer.createTrigger(...) with null, giving

   public Trigger createTrigger(long timestamp,
                                 String[] calendarNames,
                                 Calendars calendars) {
        return new CompositeMaxDurationTrigger( new Date( getMaxDuration() + timestamp ),
                                                null,
                                                calendarNames,
                                                calendars );
    }



> NullPointerException from CompositeMaxDurationTimer.createTrigger
> -----------------------------------------------------------------
>
>                 Key: JBRULES-2729
>                 URL: https://jira.jboss.org/browse/JBRULES-2729
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-compiler
>    Affects Versions: 5.1.1.FINAL
>         Environment: Windows XP SP3, Java 1.6.0_21, Drools Fusion 5.1.1
>            Reporter: Will Lauer
>            Assignee: Mark Proctor
>
> The timer field of CompositeMaxDurationTimer appears to be not getting populated correctly when certain types of rules are created in Drools Fusion. This results in subsequent calls to CompositeMaxDurationTimer.createTimer to reference a null pointer during execution. While the error triggers during fact insertion in Drools Fusion, it appears to be due to an incomplete timer definition during rules compilation.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list