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

master
Juergen Hoeller 13 years ago committed by Chris Beams
parent cc2e558fe0
commit 00ff8fa2cc
  1. 8
      org.springframework.context.support/src/main/java/org/springframework/scheduling/quartz/QuartzJobBean.java

@ -79,10 +79,12 @@ public abstract class QuartzJobBean implements Job {
static {
try {
getSchedulerMethod = JobExecutionContext.class.getMethod("getScheduler");
getMergedJobDataMapMethod = JobExecutionContext.class.getMethod("getMergedJobDataMap");
Class jobExecutionContextClass =
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);
}
}

Loading…
Cancel
Save