1

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

提前感谢您的回答!非常感激!

4

1 回答 1

2

您的设置时间超出范围。Spring Quartz 永远不会执行超出时间范围的任务。因此请更改设置时间。

于 2012-08-03T07:07:28.200 回答