corrected fix for QuartzJobBean to work with Quartz 2.0/2.1 (SPR-8889)

This commit is contained in:
Juergen Hoeller 2011-12-21 13:35:48 +01:00 committed by Chris Beams
parent cc2e558fe0
commit 00ff8fa2cc
1 changed files with 5 additions and 3 deletions

View File

@ -79,10 +79,12 @@ public abstract class QuartzJobBean implements Job {
static { static {
try { try {
getSchedulerMethod = JobExecutionContext.class.getMethod("getScheduler"); Class jobExecutionContextClass =
getMergedJobDataMapMethod = JobExecutionContext.class.getMethod("getMergedJobDataMap"); QuartzJobBean.class.getClassLoader().loadClass("org.quartz.JobExecutionContext");
getSchedulerMethod = jobExecutionContextClass.getMethod("getScheduler");
getMergedJobDataMapMethod = jobExecutionContextClass.getMethod("getMergedJobDataMap");
} }
catch (NoSuchMethodException ex) { catch (Exception ex) {
throw new IllegalStateException("Incompatible Quartz API: " + ex); throw new IllegalStateException("Incompatible Quartz API: " + ex);
} }
} }