Timer created using the EJB TimerService is creating a wrong first execution date/time in JBoss EAP 6
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Issue
If a Timer is created using the EJB TimerService a wrong first execution date/time is calculated
A new timer created at this time Mon Jan 18 09:22:35 GMT+1 2016 with the following parameters:
ScheduleExpression[second=0 minute=0/5 hour=20-22 dayOfWeek=* dayOfMonth=* month=* year=* start=Mon Jan 18 09:45:00 GMT+1 2016]
The first schedule should be :
Mon Jan 18 20:00:00 GMT+1 2016
but is calculated as :
Mon Jan 18 20:45:00 GMT+1 2016
The minutes are not correctly set according to the schedule.
This happen for seconds/minutes if the ScheduleExpression limit the range and the start date is somewhat outside of the possible timeout range.
Resolution
The issue has been opened and will be addressed in a future cumulative patch of JBoss EAP 6.4 after CP6
Root Cause
The initial time is not correct calculated if the start time given in the ScheduleExpression did not match the criteria for time, day, month given by the other parameters of the ScheduleExpression.
As a workaround the start time can be set to the first possible timeout or 00:00:00.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.