springboot整合quartz遇到的错误

1、spring boot整合quartz执行多个定时任务时报:

org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'group1.job1', because one already exists with this identification.

定时任务虽然执行,但报了错误。第一次执行时没有报错误,第二次及之后执行前会报这个错误,

解决办法:
在初始化调度的时候clean一下:    scheduler.clear();

 

posted @ 2020-05-31 15:01  遗忘无际  阅读(2684)  评论(0编辑  收藏  举报