Skip to content
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

Closed
spring-projects-issues opened this issue Apr 26, 2011 · 10 comments
Closed

Support Quartz 2.0.x [SPR-8275] #12923

spring-projects-issues opened this issue Apr 26, 2011 · 10 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 26, 2011

Chris Beams opened SPR-8275 and commented


Issue Links:

Referenced from: commits f265347, 16933a5, 69c9abf

4 votes, 7 watchers

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Apr 26, 2011

Chris Beams commented

See comments and patch in #12642

@spring-projects-issues
Copy link
Collaborator Author

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

@spring-projects-issues
Copy link
Collaborator Author

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.

@spring-projects-issues
Copy link
Collaborator Author

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

@spring-projects-issues
Copy link
Collaborator Author

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

@spring-projects-issues
Copy link
Collaborator Author

Dennis Kieselhorst commented

Works except for repeatCount. This attribute is missing on SimpleTriggerFactoryBean.

@spring-projects-issues
Copy link
Collaborator Author

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

@spring-projects-issues
Copy link
Collaborator Author

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.

https://issues.apache.org/bugzilla/show_bug.cgi?id=52444

@spring-projects-issues
Copy link
Collaborator Author

Benjamin Jaton commented

I also experience the same error:
java.lang.IncompatibleClassChangeError: class org.springframework.scheduling.quartz.SimpleTriggerBean has interface org.quartz.SimpleTrigger as super class

spring 3.1.3.RELEASE
quartz 2.1.0

As a workaround I am using org.springframework.scheduling.quartz.SimpleTriggerFactoryBean to declare my bean.
( see http://devtrigger.blogspot.com/2012/02/spring-31-with-quartz-212.html )

@spring-projects-issues
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants