Unable to store Trigger with name: 'trigger1' and group: 'group1', because one already exists with this identification
【转载】
对trigger的key进行判断
boolean flag = scheduler.checkExists(trigger.getKey()); if (!flag) { scheduler.start(); scheduler.scheduleJob(job, trigger); } else { Trigger trigger1 =TriggerBuilder.newTrigger().withIdentity("schedulerJobTrigger1", "group1").withSchedule(schedBuilder).build();; scheduler.start(); scheduler.scheduleJob(job, trigger1); }
一分辛苦一分才