Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 石英:根据配置的时间表,给定的触发器永远不会触发_Java_Cron_Quartz Scheduler - Fatal编程技术网

Java 石英:根据配置的时间表,给定的触发器永远不会触发

Java 石英:根据配置的时间表,给定的触发器永远不会触发,java,cron,quartz-scheduler,Java,Cron,Quartz Scheduler,在安排作业时,我收到“基于配置的计划,给定的触发器将永远不会触发”错误。我曾尝试将“.startNow()”添加到触发器中,但没有解决问题。我不明白我做错了什么 JobDetail jobDetail = newJob(DeploymentJob.class) .withIdentity(scheduleName) .usingJobData("uploadLocation", deployment.getUploadDir()) .build()

在安排作业时,我收到“基于配置的计划,给定的触发器将永远不会触发”错误。我曾尝试将“.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();
jobdail jobdail=newJob(DeploymentJob.class)
.withIdentity(scheduleName)
.usingJobData(“uploadLocation”,deployment.getUploadDir())
.build();
//将作业添加到计划程序
scheduler.addJob(jobDetail,true);
//使用cron表达式创建触发器
触发器=newTrigger()
.withIdentity(scheduleName)
.withSchedule(cronSchedule(cron))
.forJob(作业详细信息)
.build();
//告诉quartz使用触发器安排作业

scheduleJob(作业详细信息,触发器) 您的设置时间遥不可及。Spring Quartz从不执行时间遥不可及的任务。因此请更改您的设置时间。

cronSchedule(cron)返回什么?它返回CronScheduleBuilder cron字符串是根据用户在前端选择的日期/时间生成的。它将始终是“单次运行”事件。示例:2012-07-2315:30:00 Cron:0303237?2012年不是应该是0 30 15 23 7吗?2012年你是对的!不知道我怎么会错过,叹息。谢谢我现在正在与一个不同的错误作斗争,但在问这个问题之前,让我自己花一些时间在这个问题上。我想知道你所说的遥不可及是什么意思?我也有同样的错误。限制是多少?