Reputation: 590
I am trying to use Quartz 2.1.1 with Spring 3.0.5.
I set up the Scheduler with this line:
<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"/>
I wrote a simple class called TestJob
that implements the Job
interface. I am able to successfully set up a job and trigger and schedule it. The problem is that when the job is triggered and quartz tries to instantiate the TestJob
class, I am getting this error:
[scheduler_QuartzSchedulerThread] ERROR core.ErrorLogger.schedulerError(2360) | An error occured instantiating job to be
executed. job= 'TEST_JOB.6d2e7ca2-20cd-4e5f-9f32-1626c7128a5d'
org.quartz.SchedulerException: Problem instantiating class 'com.scheduler.TestJob' - [See nes
ted exception: java.lang.AbstractMethodError: org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(Lorg/quar
tz/spi/TriggerFiredBundle;Lorg/quartz/Scheduler;)Lorg/quartz/Job;]
at org.quartz.core.JobRunShell.initialize(JobRunShell.java:141)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:381)
Caused by: java.lang.AbstractMethodError: org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(Lorg/quartz/s
pi/TriggerFiredBundle;Lorg/quartz/Scheduler;)Lorg/quartz/Job;
at org.quartz.core.JobRunShell.initialize(JobRunShell.java:134)
... 1 more
Any ideas on how to get around this issue?
Upvotes: 5
Views: 10789
Reputation: 571
I just had a very similar problem that led me here - caused by refactoring a job's package - everything worked till it was deployed to a cluster - quartz jdbc uses tables with job_name column with the old package persisted so it choked with this same error. Delete the persisted trigger rows, or put it back where it was to resolve.
Upvotes: 1
Reputation: 21
You also can assign the jobFactory to quartz custom job factory "SimpleJobFactory"
Upvotes: 2
Reputation: 11606
Quartz 2 and Spring < 3.1 are incompatible. So you can either update to Spring 3.1 or downgrade to Quartz 1.8. Or you drop the Spring Quartz adapters and use Quartz 2 by hand. I recommend the very first method.
Upvotes: 10