Spring Quartz动态添加作业

时间:2017-02-17 19:23:46

标签: spring quartz-scheduler spring-scheduled

我正在尝试通过

动态地向调度程序添加作业
schedulerFactoryBean.getScheduler().scheduleJob(cronTrigger);

但这是错误的

Caused by: org.quartz.JobPersistenceException: The job (JOB_GROUP.JOB_NAME) referenced by the trigger does not exist.
    at org.quartz.simpl.RAMJobStore.storeTrigger(RAMJobStore.java:422)
    at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:932)
    at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:258)
    at com.abc.RescheduleJob.rescheduleJobs(RescheduleJob.java:32)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)

请帮忙。

0 个答案:

没有答案