0

我正在尝试将我的简单石英作业转换为 JBOSS EAP 6.4 中的 EJB 计时器服务作业。

我遇到了一个我无法找到好的答案的问题。我想每天凌晨 1 点运行一次此方法。

这是我的课。

@Singleton
@Startup
public class JobExecutorService {

    @Schedule(second = "*", minute = "*", hour = "1",persistent = false)
    public void scheduleJobs() throws InterruptedException {
        new ClinicalTrialsDataExtractor().execute();
    }
}

我在控制台中收到这些错误:

16:51:20,002 WARN  [org.jboss.as.ejb3] (EJB default - 3) JBAS014143: A previous execution of timer [clinicalTrials.clinicalTrials.JobExecutorService ed420447-56b0-4d27-9533-f77e8a80ffbb] is still in progress, skipping this overlapping scheduled execution at: Tue Feb 23 16:51:20 EST 2016 as timer state is IN_TIMEOUT
16:51:21,004 WARN  [org.jboss.as.ejb3] (EJB default - 4) JBAS014143: A previous execution of timer [clinicalTrials.clinicalTrials.JobExecutorService ed420447-56b0-4d27-9533-f77e8a80ffbb] is still in progress, skipping this overlapping scheduled execution at: Tue Feb 23 16:51:21 EST 2016 as timer state is IN_TIMEOUT
16:51:22,005 WARN  [org.jboss.as.ejb3] (EJB default - 5) JBAS014143: A previous execution of timer [clinicalTrials.clinicalTrials.JobExecutorService ed420447-56b0-4d27-9533-f77e8a80ffbb] is still in progress, skipping this overlapping scheduled execution at: Tue Feb 23 16:51:22 EST 2016 as timer state is IN_TIMEOUT
16:51:23,004 WARN  [org.jboss.as.ejb3] (EJB default - 6) JBAS014143: A previous execution of timer [clinicalTrials.clinicalTrials.JobExecutorService ed420447-56b0-4d27-9533-f77e8a80ffbb] is still in progress, skipping this overlapping scheduled execution at: Tue Feb 23 16:51:23 EST 2016 as timer state is IN_TIMEOUT
16:51:24,002 WARN  [org.jboss.as.ejb3] (EJB default - 7) JBAS014143: A previous execution of timer [clinicalTrials.clinicalTrials.JobExecutorService ed420447-56b0-4d27-9533-f77e8a80ffbb] is still in progress, skipping this overlapping scheduled execution at: Tue Feb 23 16:51:24 EST 2016 as timer state is IN_TIMEOUT

防止这些线程尝试启动的最简单方法是什么?

4

1 回答 1

0

我很惊讶没有人回答这个相对简单的问题。问题归结为我的 @Schedule 注释中的错误。该方法试图每秒触发一次,因此 *. 正确的方法是:

@Schedule(second = "0", minute = "0", hour = "1",persistent = false)
public void scheduleJobs() throws InterruptedException {
        new ClinicalTrialsDataExtractor().execute();
}
于 2016-02-24T15:41:20.880 回答