从失败的Qualtz中恢复数据库错误

时间:2016-10-26 10:02:19

标签: java quartz-scheduler

我将Quartz配置为使用数据库中的预定作业。 现在,当我用以下内容启动调度程序时:

org.quartz.scheduler.instanceName = DatabaseScheduler
org.quartz.scheduler.skipUpdateCheck = true
org.quartz.threadPool.threadCount = 3

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.MSSQLDelegate
org.quartz.dataSource.myDB.driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
org.quartz.dataSource.myDB.URL = jdbc:sqlserver://server:1433;databaseName=schedules
org.quartz.dataSource.myDB.user = sa     
org.quartz.dataSource.myDB.password = password
org.quartz.dataSource.myDB.maxConnections = 2

org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.dataSource = myDB
org.quartz.scheduler.misfirePolicy =  doNothing

项目的配置文件如下:

org.quartz.JobPersistenceException: Database error recovering from misfires. [See nested exception: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException]
    at org.quartz.impl.jdbcjobstore.JobStoreSupport.doRecoverMisfires(JobStoreSupport.java:3213)
    at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.manage(JobStoreSupport.java:3951)
    at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.run(JobStoreSupport.java:3972)
Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62)
    at com.mchange.v2.c3p0.stmt.GooGooStatementCache.acquireStatement(GooGooStatementCache.java:562)
    at com.mchange.v2.c3p0.stmt.GooGooStatementCache.checkoutStatement(GooGooStatementCache.java:168)
    at com.mchange.v2.c3p0.impl.NewPooledConnection.checkoutStatement(NewPooledConnection.java:234)
    at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:73)
    at com.sun.proxy.$Proxy3.prepareStatement(Unknown Source)
    at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.countMisfiredTriggersInState(StdJDBCDelegate.java:390)
    at org.quartz.impl.jdbcjobstore.JobStoreSupport.doRecoverMisfires(JobStoreSupport.java:3192)
    ... 2 more

我得到的错误是:

{{1}}

有人可以帮我解决这个错误吗?我还查看了stackoverflow MDN's Documentation on Object.values()。没有运气。我使用的是Quartz 2.2.3。即使我的数据库表为空,我也收到了错误。

1 个答案:

答案 0 :(得分:0)

发现了这个问题。在我的源代码中,调度程序启动并立即关闭调度程序。在这段时间内,无法调度任何内容,并且在调用close之前调度程序的启动也没有完成。删除关闭调用它正常工作。