Scheduler throwing exception related to DateTime

2 views
Skip to first unread message

Russell Gillen

unread,
Jul 1, 2013, 3:08:47 PM7/1/13
to motech-dev
Hi, I have moved the Ethiopia Indicator Reporting app (not the pill reminder project) to use MySQL job storage. In this project we are using the schedule tracking module, in the ICAPPR project we aren't. We're also using the 0.19 release. I am seeing the scheduler complain about Joda DateTime, both during normal operation and during job recovery on server restart. Does anyone have any ideas on what is happening? It looks like a class loading issue to me, but the scheduler module has access to that class, and I thought the platform as a whole did. Thanks for any help.

org.springframework.context.ApplicationContextException: Failed to start bean 's
chedulerFactory'; nested exception is org.springframework.scheduling.SchedulingE
xception: Could not start Quartz Scheduler; nested exception is org.quartz.Sched
ulerConfigException: Failure occured during job recovery. [See nested exception:
 org.quartz.JobPersistenceException: Couldn't store trigger 'default.org.motechp
roject.scheduletracking.api.milestone.alert-bc2fefca08dd141e09fbc05598624cef.0-r
epeat' for 'default.org.motechproject.scheduletracking.api.milestone.alert-bc2fe
fca08dd141e09fbc05598624cef.0-repeat' job:org.joda.time.DateTime [See nested exc
eption: java.lang.ClassNotFoundException: org.joda.time.DateTime]]
        at org.springframework.context.support.DefaultLifecycleProcessor.doStart
(DefaultLifecycleProcessor.java:170)
        at org.springframework.context.support.DefaultLifecycleProcessor.access$
1(DefaultLifecycleProcessor.java:154)
        at org.springframework.context.support.DefaultLifecycleProcessor$Lifecyc
leGroup.start(DefaultLifecycleProcessor.java:339)
        at org.springframework.context.support.DefaultLifecycleProcessor.startBe
ans(DefaultLifecycleProcessor.java:143)
        at org.springframework.context.support.DefaultLifecycleProcessor.onRefre
sh(DefaultLifecycleProcessor.java:108)
        at org.springframework.context.support.AbstractApplicationContext.finish
Refresh(AbstractApplicationContext.java:926)
        at org.eclipse.gemini.blueprint.context.support.AbstractOsgiBundleApplic
ationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:221)
        at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecuti
onApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:328
)
        at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWit
hCustomTCCL(PrivilegedUtils.java:85)
        at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecuti
onApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContex
t.java:290)
        at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.D
ependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWait
erApplicationContextExecutor.java:137)
        at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.scheduling.SchedulingException: Could not start Q
uartz Scheduler; nested exception is org.quartz.SchedulerConfigException: Failur
e occured during job recovery. [See nested exception: org.quartz.JobPersistenceE
xception: Couldn't store trigger 'default.org.motechproject.scheduletracking.api
.milestone.alert-bc2fefca08dd141e09fbc05598624cef.0-repeat' for 'default.org.mot
echproject.scheduletracking.api.milestone.alert-bc2fefca08dd141e09fbc05598624cef
.0-repeat' job:org.joda.time.DateTime [See nested exception: java.lang.ClassNotF
oundException: org.joda.time.DateTime]]
        at org.springframework.scheduling.quartz.SchedulerFactoryBean.start(Sche
dulerFactoryBean.java:715)
        at org.springframework.context.support.DefaultLifecycleProcessor.doStart
(DefaultLifecycleProcessor.java:167)
        ... 11 more
Caused by: org.quartz.SchedulerConfigException: Failure occured during job recov
ery. [See nested exception: org.quartz.JobPersistenceException: Couldn't store t
rigger 'default.org.motechproject.scheduletracking.api.milestone.alert-bc2fefca0
8dd141e09fbc05598624cef.0-repeat' for 'default.org.motechproject.scheduletrackin
g.api.milestone.alert-bc2fefca08dd141e09fbc05598624cef.0-repeat' job:org.joda.ti
me.DateTime [See nested exception: java.lang.ClassNotFoundException: org.joda.ti
me.DateTime]]
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStor
eSupport.java:683)
        at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:526)
        at org.quartz.impl.StdScheduler.start(StdScheduler.java:143)
        at org.springframework.scheduling.quartz.SchedulerFactoryBean.startSched
uler(SchedulerFactoryBean.java:649)
        at org.springframework.scheduling.quartz.SchedulerFactoryBean.start(Sche
dulerFactoryBean.java:712)
        ... 12 more
Caused by: org.quartz.JobPersistenceException: Couldn't store trigger 'default.o
rg.motechproject.scheduletracking.api.milestone.alert-bc2fefca08dd141e09fbc05598
624cef.0-repeat' for 'default.org.motechproject.scheduletracking.api.milestone.a
lert-bc2fefca08dd141e09fbc05598624cef.0-repeat' job:org.joda.time.DateTime [See
nested exception: java.lang.ClassNotFoundException: org.joda.time.DateTime]
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSup
port.java:1212)

Russell Gillen

unread,
Jul 3, 2013, 1:33:47 PM7/3/13
to motech-dev
Hi, I have confirmed that this bug also exists in the 0.20 release. It appears to be caused by Tomcat webapp class loader not having the joda DateTime class available to it, although it has no problem scheduling the initial job. By putting the joda time jar in either the Tomcat lib folder, or the Motech webapp's WEB-INF/lib folder, the problem is resolved and events are triggered and recovered with normal behavior. I will put a card in for this. I believe the platform should be including the joda jar with the webapp. 

-Russell

2013-07-03 11:51:47,670 ERROR [org.quartz.core.ErrorLogger] An error occurred wh
ile scanning for the next triggers to fire.
org.quartz.JobPersistenceException: Couldn't acquire next trigger: org.joda.time
.DateTime [See nested exception: java.lang.ClassNotFoundException: org.joda.time
.DateTime]
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobSt
oreSupport.java:2840)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSuppo
rt.java:2755)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLoc
k(JobStoreSupport.java:3811)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobS
toreSupport.java:2751)
        at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:
264)
Caused by: java.lang.ClassNotFoundException: org.joda.time.DateTime
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1688)
Reply all
Reply to author
Forward
0 new messages