我在单例EJB中定义了一些持久性计时器,如下所示(使用WildFly 9.0.2 final)。

@Startup
@Singleton
@Lock(LockType.READ)
public class BackgroundJobManager implements BackgroundJobService {

    @Schedule(dayOfMonth = "1", month = "Jan", year = "*", hour = "0", minute = "0", second = "0", persistent = true)
    private void doYearlyJob() {
        //...
    }

    @Schedule(hour = "*", minute = "*/5", second = "0", persistent = true)
    private void updateTopSellers() {
        //...
    }

    @Schedule(hour = "*", minute = "*/1", second = "0", persistent = true)
    private void updateFeedback() {
        //...
    }

    //...
}

在服务器启动时以及在重新部署应用程序时会发出一些警告,如下所示(这些警告只是其中的一部分)。
19:46:51,687 WARN  [org.jboss.as.ejb3] (EJB default - 3) WFLYEJB0043: A previous execution of timer [id=15baaed1-d804-48fc-acdb-80ea3e04735f timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 16:25:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:51 IST 2015.
19:46:51,796 WARN  [org.jboss.as.ejb3] (EJB default - 4) WFLYEJB0043: A previous execution of timer [id=fc285ef2-c7a1-4a2e-af57-d320c769b445 timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 22:50:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:51 IST 2015.
19:46:51,890 WARN  [org.jboss.as.ejb3] (EJB default - 5) WFLYEJB0043: A previous execution of timer [id=15baaed1-d804-48fc-acdb-80ea3e04735f timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 16:26:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:51 IST 2015.
19:46:51,953 WARN  [org.jboss.as.ejb3] (EJB default - 6) WFLYEJB0043: A previous execution of timer [id=fc285ef2-c7a1-4a2e-af57-d320c769b445 timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 22:55:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:51 IST 2015.
19:46:51,984 WARN  [org.jboss.as.ejb3] (EJB default - 7) WFLYEJB0043: A previous execution of timer [id=15baaed1-d804-48fc-acdb-80ea3e04735f timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 16:27:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:51 IST 2015.
19:46:52,062 WARN  [org.jboss.as.ejb3] (EJB default - 8) WFLYEJB0043: A previous execution of timer [id=fc285ef2-c7a1-4a2e-af57-d320c769b445 timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 23:00:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.
19:46:52,218 WARN  [org.jboss.as.ejb3] (EJB default - 9) WFLYEJB0043: A previous execution of timer [id=15baaed1-d804-48fc-acdb-80ea3e04735f timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 16:28:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.
19:46:52,328 WARN  [org.jboss.as.ejb3] (EJB default - 10) WFLYEJB0043: A previous execution of timer [id=fc285ef2-c7a1-4a2e-af57-d320c769b445 timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 23:05:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.
19:46:52,390 WARN  [org.jboss.as.ejb3] (EJB default - 3) WFLYEJB0043: A previous execution of timer [id=15baaed1-d804-48fc-acdb-80ea3e04735f timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 16:29:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.
19:46:52,453 WARN  [org.jboss.as.ejb3] (EJB default - 4) WFLYEJB0043: A previous execution of timer [id=fc285ef2-c7a1-4a2e-af57-d320c769b445 timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 23:10:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.
19:46:52,484 WARN  [org.jboss.as.ejb3] (EJB default - 5) WFLYEJB0043: A previous execution of timer [id=15baaed1-d804-48fc-acdb-80ea3e04735f timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 16:30:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.
19:46:52,531 WARN  [org.jboss.as.ejb3] (EJB default - 6) WFLYEJB0043: A previous execution of timer [id=fc285ef2-c7a1-4a2e-af57-d320c769b445 timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 23:15:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.
19:46:52,593 WARN  [org.jboss.as.ejb3] (EJB default - 7) WFLYEJB0043: A previous execution of timer [id=15baaed1-d804-48fc-acdb-80ea3e04735f timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 16:31:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.
19:46:52,687 WARN  [org.jboss.as.ejb3] (EJB default - 8) WFLYEJB0043: A previous execution of timer [id=fc285ef2-c7a1-4a2e-af57-d320c769b445 timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 23:20:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.
19:46:52,781 WARN  [org.jboss.as.ejb3] (EJB default - 9) WFLYEJB0043: A previous execution of timer [id=15baaed1-d804-48fc-acdb-80ea3e04735f timedObjectId=WildFly.WildFly-ejb.BackgroundJobManager auto-timer?:true persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@9e86f initialExpiration=null intervalDuration(in milli sec)=0 nextExpiration=Fri Dec 11 16:32:00 IST 2015 timerState=IN_TIMEOUT info=null] is still in progress, skipping this overlapping scheduled execution at: Sat Dec 12 19:46:52 IST 2015.

计时器服务在standalone-full-ha.xml中定义如下。

<timer-service thread-pool-name="default" default-data-store="clustered-store">
    <data-stores>
        <database-data-store name="clustered-store" datasource-jndi-name="java:jboss/datasources/projectXADatasource" database="mysql" partition="timer"/>
    </data-stores>
</timer-service>

当这些计时器代替数据库持久保存到文件系统时,无论将应用程序部署在集群(standalone-full-ha.xml)还是非集群(standalone-full.xml)环境中,这些警告也会出现。

如有必要,我会定期清除standalone/data的所有内容(已部署的JDBC驱动程序和自定义内容除外),standalone/deploymentsstandalone/tmp。在最初将计时器持久保存到文件系统时,standalone/data中不再提供计时器的症状。

有解决办法吗?

有一个question,但我对给出的答案不满意(对不起)。此外,该问题使用JBoss EAP 6.4,为什么在应用程序服务器中使用EJB时​​在其中显示spring标签对我来说还是个谜。

更新:

该问题在WildFly 10.0.0 final中仍然存在。

最佳答案

这是一个公认的错误。参见https://issues.jboss.org/browse/WFLY-6561

该错误也已应用于JBoss 7:https://issues.jboss.org/browse/JBEAP-4442

关于jakarta-ee - WFLYEJB0043 : A previous execution of timer [timer] is still in progress,在[时间]跳过此重叠的计划执行,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34241076/

10-09 17:31