我在调度作业时收到“基于已配置的计划,给定的触发器永远不会触发”错误。我尝试在触发器中添加“.startNow()”,但这并没有解决它。我不明白我做错了什么。
JobDetail jobDetail = newJob(DeploymentJob.class)
.withIdentity(scheduleName)
.usingJobData("uploadLocation", deployment.getUploadDir())
.build();
// Add the job to the Scheduler
scheduler.addJob(jobDetail, true);
// Create the trigger with cron expression
Trigger trigger = newTrigger()
.withIdentity(scheduleName)
.withSchedule(cronSchedule(cron))
.forJob(jobDetail)
.build();
// Tell quartz to schedule the job using our trigger
scheduler.scheduleJob(jobDetail, trigger); <--- Problem line.
scheduler.start();
提前感谢您的答案!非常感谢!
答案 0 :(得分:2)
您的设置时间无法实现.Spring Quartz永远不会执行时间超出的任务。所以更改您的设置时间。