Spring 3 + Quartz 2 error Spring 3 + Quartz 2 error spring spring

Spring 3 + Quartz 2 error


If you use Spring 3.1,

Replace the SimpleTriggerBean with SimpleTriggerFactoryBean

In the 3.1 release, Spring has created Factory classes for crontrigger and simpletrigger

Update:

Using Spring 3.2.2, must be useful to change also JobDetailBean => JobDetailFactoryBean and CronTriggerBean => CronTriggerFactoryBean.

Credit to Osy (vote on the comment below)


Last I checked, Spring doesn't have support for Quartz 2. Either have a look to see if the most recent Spring builds have added said support, or try downgrading to Quartz 1.8.x.


According to the 3.1.0.RC1 Change Log, Spring 3.1 has support for Quartz 2.x.

For every {Type}TriggerBean there is now a {Type}TriggerBeanFactory which can be used to setup triggers. In your case this would be SimpleTriggerFactoryBean

Excerpt

NOTE: This FactoryBean works against both Quartz 1.x and Quartz 2.0/2.1, in contrast to the older SimpleTriggerBean class.

Sidenote

You might also need to add the org.springframework.transaction dependency, depending on which type of trigger you are using:

<dependency>    <groupId>org.springframework</groupId>    <artifactId>spring-tx</artifactId>    <version>3.1.2.RELEASE</version></dependency>

We needed it for migration to Quartz 2 in a configuration using CronTriggerFactoryBean triggers.