从失火 Qualtz 中恢复的数据库错误
Database error recovering from misfires Qualtz
我将 Quartz 配置为使用数据库中的计划作业。
现在,当我启动调度程序时:
try {
// Grab the Scheduler instance from the Factory
Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
// and start it off
scheduler.start();
scheduler.shutdown();
} catch (Exception se) {
Log.log(LogLevel.ERROR, se.getMessage());
}
项目的配置文件如下所示:
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
有人可以帮我解决这个错误吗?我还查看了 Whosebug 。没有任何运气。我正在使用 Quartz 2.2.3。即使我的数据库表是空的,我也会收到错误。
发现问题。在我的源代码中,调度程序启动并立即关闭调度程序。在这段时间里,什么都不能安排,而且在调用关闭之前调度程序的启动还没有完成。删除关闭调用它工作正常。
我将 Quartz 配置为使用数据库中的计划作业。 现在,当我启动调度程序时:
try {
// Grab the Scheduler instance from the Factory
Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
// and start it off
scheduler.start();
scheduler.shutdown();
} catch (Exception se) {
Log.log(LogLevel.ERROR, se.getMessage());
}
项目的配置文件如下所示:
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
有人可以帮我解决这个错误吗?我还查看了 Whosebug
发现问题。在我的源代码中,调度程序启动并立即关闭调度程序。在这段时间里,什么都不能安排,而且在调用关闭之前调度程序的启动还没有完成。删除关闭调用它工作正常。