我在安排我的工作时收到“基于配置的计划,给定的触发器永远不会触发”错误。我尝试将“.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();
提前感谢您的回答!非常感激!