Details
-
Improvement
-
Resolution: Won't Do
-
Neutral
-
None
-
2.2.2
-
None
Description
Cron allows to set a job for one time execution (e.g. 0 45 0 25 5 ? 2016). When such a job is finished following exception is thrown (the same when the cron for the past is inserted directly)
2016-05-10 16:57:47,385 ERROR info.magnolia.module.scheduler.JobDefinition : Can't initialize job [RunCommandLater-1462896906716]
org.quartz.SchedulerException: Can't schedule jobRunCommandLater-1462896906716 [See nested exception: org.quartz.SchedulerException: Based on configured schedule, the given trigger will never fire.]
at info.magnolia.module.scheduler.SchedulerModule.initJob(SchedulerModule.java:172)
at info.magnolia.module.scheduler.SchedulerModule.initJobs(SchedulerModule.java:156)
at info.magnolia.module.scheduler.SchedulerModule.start(SchedulerModule.java:146)
at info.magnolia.module.ModuleManagerImpl.startModule(ModuleManagerImpl.java:414)
at info.magnolia.module.ModuleManagerImpl$2$1.doExec(ModuleManagerImpl.java:373)
at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:421)
at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:418)
at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:392)
at info.magnolia.module.ModuleManagerImpl$2.onEvent(ModuleManagerImpl.java:368)
at info.magnolia.cms.util.ObservationUtil$ObservationBasedDelayedExecutor$1.run(ObservationUtil.java:276)
at info.magnolia.cms.util.DelayedExecutor$RunnableWrapper.run(DelayedExecutor.java:103)
at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.quartz.SchedulerException: Based on configured schedule, the given trigger will never fire.
at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:817)
at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:243)
at info.magnolia.module.scheduler.SchedulerModule.startJob(SchedulerModule.java:199)
at info.magnolia.module.scheduler.SchedulerModule.initJob(SchedulerModule.java:170)
... 12 more
Instead such event should be handled by the module.
Proposed solution - set enabled property of the job to false and print INFO or WARN level message.
Checklists
Acceptance criteria