-
Notifications
You must be signed in to change notification settings - Fork 38.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Quartz 2.0.x [SPR-8275] #12923
Comments
Chris Beams commented See comments and patch in #12642 |
Juergen Hoeller commented This has been promoted to a Spring 3.1 feature and is fully addressed for 3.1 RC1 now. Note that JobDetailBean and Cron/SimpleTriggerBean do not work against Quartz 2.0, and never will. Use Quartz 2.0's native JobDetailImpl etc classes or the new Quartz 2.0 builder API instead (see the Quartz 2.0 migration guide for details). Juergen |
Manuel Dominguez Sarmiento commented What about MethodInvokingJobDetailFactoryBean? This does not work at all with Quartz 2.x / Spring 3.1 since it attempts to instantiate JobDetailBean which is incompatible with Quartz 2.x Also, I do not agree that CronTriggerBean should not be supported for Quartz 2.x - we use declarative XML configuration and would have to overhaul everything to use job names/groups instead of bean references in order to wire everything together. |
Juergen Hoeller commented MethodInvokingJobDetailFactoryBean's Quartz 2.0 support had a bug in 3.1 RC1 which got fixed in trunk already, so it should work with 3.1 RC2 which is about to be released later this November. As for CronTriggerBean and co, what we could do is to provide equivalent classes for Quartz 2.0 which mimic the functionality in the original CronTriggerBean class: e.g. a CronTriggerImplBean. Juergen |
Juergen Hoeller commented Good news: As of 3.1 RC2 which is scheduled for immediate release, we have JobDetailFactoryBean, CronTriggerFactoryBean and SimpleTriggerFactoryBean classes as alternatives for the non-factory variants that we had before. These new FactoryBeans are able to do their job against Quartz 1.x as well as Quartz 2.0/2.1, so can also be used for portable configuration across all Quartz versions. Switching to the FactoryBeans should be a simple class renaming exercise in your configuration, with all of the common properties supported with the exact same names (let me know if you find any desirable properties missing). Juergen |
Dennis Kieselhorst commented Works except for repeatCount. This attribute is missing on SimpleTriggerFactoryBean. |
Markus Bäurle commented Hmm, I get an java.lang.IncompatibleClassChangeError: class org.springframework.scheduling.quartz.CronTriggerBean has interface org.quartz.CronTrigger as super class when Tomcat starts. I use Spring 3.1.0.RELEASE and use the new classes CronTriggerFactoryBean and JobDetailFactoryBean. But it seems that Tomcat tries to load this class on startup before Spring configuration |
Chris Beams commented Hi Markus, See this bug to understand the Tomcat classloading problem. It is fixed in 7.0.26; try upgrading and let us know (in a new issue, please) if you still have any problems. |
Benjamin Jaton commented I also experience the same error: spring 3.1.3.RELEASE As a workaround I am using org.springframework.scheduling.quartz.SimpleTriggerFactoryBean to declare my bean. |
Juergen Hoeller commented Benjamin, as per the comments above and as also stated in the SimpleTriggerBean javadoc, this class does not work with Quartz 2.x, which is exactly why we added SimpleTriggerFactoryBean as its successor. So using SimpleTriggerFactoryBean is not a workaround; it's the recommended approach now, automatically adapting between Quartz 1.x and 2.x through reflection. The IncompatibleClassChangeError has its roots in a breakage between Quartz 1.x and Quartz 2.x, where SimpleTrigger changed from a class to an interface. Since our SimpleTriggerBean extends the former SimpleTrigger class, its design is unfortunately inherently tied to Quartz 1.x. SimpleTriggerFactoryBean on the other hand uses a more flexible factory approach now. Juergen |
Chris Beams opened SPR-8275 and commented
Issue Links:
Referenced from: commits f265347, 16933a5, 69c9abf
4 votes, 7 watchers
The text was updated successfully, but these errors were encountered: