5
votes

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?

3
Could you show the code of your TestJob class? And also the scheduling of your job?Alexis Dufrenoy

3 Answers

10
votes

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.

2
votes

You also can assign the jobFactory to quartz custom job factory "SimpleJobFactory"

1
votes

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.