NoMoreTimeoutsException for single action timer.
------------------------------------------------

                 Key: OPENEJB-1520
                 URL: https://issues.apache.org/jira/browse/OPENEJB-1520
             Project: OpenEJB
          Issue Type: Bug
          Components: ejb31
    Affects Versions: (trunk/openejb3)
            Reporter: Shawn Jiang
             Fix For: 4.0


The single action timer data set the expiration as start time of the simple 
trigger, so that nextFireTime of simple trigger is still null after the 
initialization process.

org.apache.openejb.core.timer.SingleActionTimerData.initializeTrigger()

 @Override
    public Trigger initializeTrigger() {
        final SimpleTrigger simpleTrigger = new SimpleTrigger();
        simpleTrigger.setStartTime(expiration);
        return simpleTrigger;
    }


As a result,  following method will always throw NoMoreTimeoutsException 
exceptions for single action timer.

org.apache.openejb.core.timer.TimerData.getNextTimeout() {
...
        Date nextTimeout = trigger.getNextFireTime();
        if (nextTimeout == null) {
            throw new NoMoreTimeoutsException("The timer has no future 
timeouts");
...

}


To correct this, 

simpleTrigger.setStartTime(expiration);   

should be updated to

simpleTrigger.setNextFireTime(expiration);

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to