我是靠谱客的博主 阳光纸飞机,这篇文章主要介绍quartz运行中的异常,现在分享给大家,希望可以做个参考。

org.quartz.core.ErrorLogger.schedulerError(QuartzScheduler.java:2358)][org.quartz.core.ErrorLogger]:An error occured while firing trigger'DEFAULT.cronTriggerInterval'

org.quartz.JobPersistenceException:Couldn't update states of blocked triggers: Lock wait timeout exceeded; tryrestarting transaction [See nested exception: java.sql.SQLException: Lock waittimeout exceeded; try restarting transaction]

       at org.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2950)

       atorg.quartz.impl.jdbcjobstore.JobStoreSupport$38.execute(JobStoreSupport.java:2871)

       atorg.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3788)

       atorg.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2865)

       atorg.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:319)

Caused by: java.sql.SQLException: Lock waittimeout exceeded; try restarting transaction

       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)

       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)

       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)

       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)

       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)

       at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734)

       atcom.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)

       atcom.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)

       atcom.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)

       at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)

       atorg.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)

       atorg.quartz.impl.jdbcjobstore.StdJDBCDelegate.updateTriggerStatesForJobFromOtherState(StdJDBCDelegate.java:1695)

        atorg.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2943)

解决:加上org.quartz.jobStore.txIsolationLevelSerializable=true配置,问题原因由于mysql针对innodB引擎默认的事务隔离级别为“repeatableread”,非集群环境下可以使用:txIsolationLevelReadCommitted=true来设置,但集群环境下使用org.quartz.jobStore.txIsolationLevelSerializable代替txIsolationLevelReadCommitted


最后

以上就是阳光纸飞机最近收集整理的关于quartz运行中的异常的全部内容,更多相关quartz运行中内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(144)

评论列表共有 0 条评论

立即
投稿
返回
顶部