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?
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.
You also can assign the jobFactory to quartz custom job factory "SimpleJobFactory"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With