[
https://issues.apache.org/jira/browse/OPENEJB-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ivan updated OPENEJB-1520:
--------------------------
Summary: Initialize the Quartz trigger once created (was:
NoMoreTimeoutsException for single action timer.)
> Initialize the Quartz trigger once created
> ------------------------------------------
>
> 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
>
> Attachments:
> 0001-OPENEJB-1520-NoMoreTimeoutsException-for-single-acti.patch,
> 0001-OPENEJB-1520-NoMoreTimeoutsException-for-single-acti.patch
>
>
> 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