quartz在web中時有罷工(轉)
quartz整合到tomcat採用是使用 ServletContextListener方案,參見http://www.blogjava.net/Unmi/archive/2008/05/01/197657.html
tomcat執行一段時間後,控制檯報以下錯誤
2009-03-06 09:38:21 [org.quartz.core.ErrorLogger]-[ERROR] An error occured while scanning for the next trigger to fire.
org.quartz.JobPersistenceException: Couldn't rollback jdbc connection. Io 異常: Connection reset by peer: socket write error [See nested exception: java.sql.SQLException: Io 異常: Connection reset by peer: socket write error]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:2319)
at org.quartz.impl.jdbcjobstore.JobStoreTX.acquireNextTrigger(JobStoreTX.java:1222)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:233)
* Nested Exception (Underlying Cause) ---------------
java.sql.SQLException: Io 異常: Connection reset by peer: socket write error
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.rollback(OracleConnection.java:1380)
at org.apache.commons.dbcp.DelegatingConnection.rollback(DelegatingConnection.java:328)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.rollback(PoolingDataSource.java:312)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:2317)
at org.quartz.impl.jdbcjobstore.JobStoreTX.acquireNextTrigger(JobStoreTX.java:1222)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:233)
2009-03-06 09:38:46 [org.quartz.impl.jdbcjobstore.JobStoreTX]-[ERROR] MisfireHandler: Error handling misfires: Couldn't rollback jdbc connection. Io 異常: Connection reset by peer: socket write error
org.quartz.JobPersistenceException: Couldn't rollback jdbc connection. Io 異常: Connection reset by peer: socket write error [See nested exception: java.sql.SQLException: Io 異常: Connection reset by peer: socket write error]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:2319)
at org.quartz.impl.jdbcjobstore.JobStoreTX.doRecoverMisfires(JobStoreTX.java:1361)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.manage(JobStoreSupport.java:2449)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.run(JobStoreSupport.java:2468)
* Nested Exception (Underlying Cause) ---------------
java.sql.SQLException: Io 異常: Connection reset by peer: socket write error
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.rollback(OracleConnection.java:1380)
at org.apache.commons.dbcp.DelegatingConnection.rollback(DelegatingConnection.java:328)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.rollback(PoolingDataSource.java:312)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:2317)
at org.quartz.impl.jdbcjobstore.JobStoreTX.doRecoverMisfires(JobStoreTX.java:1361)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.manage(JobStoreSupport.java:2449)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.run(JobStoreSupport.java:2468)
解決方法:
org.quartz.impl.jdbcjobstore.MSSQLDelegate class which is used in DotJobStore.java.
We implemented the solution as follows:
1.Coded a new class by name org.quartz.impl.jdbcjobstore.DotMSSQLDelegate.java which extends org.quartz.impl.jdbcjobstore.MSSQLDelegate
2.overridden the method getObjectFromBlob(ResultSet rs, String colName) which has below code:
InputStream binaryInput = rs.getBinaryStream(colName);
if (binaryInput == null || binaryInput.available()== 0)
{
return null;
}
Object obj = null;
ObjectInputStream in =null;
try
{
in= new ObjectInputStream(binaryInput);
obj = in.readObject();
}catch(Exception e){
e.printStackTrace();
}
finally
{
if(in!=null)
in.close();
}
return obj;
3.We tested and it is working fine.
If it is ok for you We want to commit the code.
Are we moving in the right direction?
http://www.javauu.com/thread-16-1-1.html
相關文章
- Excel中時間戳轉換時間Excel時間戳
- 普通web整合quartz跑定時任務Webquartz
- Quartz在Spring中叢集quartzSpring
- 在.NET Core 中使用Quartz.NETquartz
- php中時間戳PHP時間戳
- 轉行web前端開發的人有沒有未來Web前端
- "黑五"將至航空公司卻鬧罷工 亞馬遜快遞有麻煩?亞馬遜
- 專案管理工具中時間跟蹤有哪些用處?專案管理
- Quartz - Quartz簡單入門quartz
- Quartz - Spring和Quartz的整合quartzSpring
- Spring Quartz Java工程版和Web工程版示例SpringquartzJavaWeb
- Quartz初探quartz
- Quartz原理quartz
- Quartz在weblogic下初始化兩次問題quartzWeb
- beego orm中時區的問題GoORM
- Pandas中時間和日期處理
- mysql中時間日期格式化MySql
- MySql中時間和日期函式MySql函式
- SQL中時間的加減法SQL
- 在 Web 頁上使用條件數值格式 (轉)Web
- 在VB和Web頁面中使用Shell物件 (轉)Web物件
- 在VxWorks的target上架設WIND Web Server (轉)WebServer
- 在Java web伺服器內使用url rewrite(轉)JavaWeb伺服器
- Sql server中時間查詢的一個比較快的語句(轉)SQLServer
- Quartz定時任務框架(二) Quartz詳解quartz框架
- 一個執行緒罷工的詭異事件執行緒事件
- Quartz 學習quartz
- Quartz 使用教程quartz
- Quartz2入門參考資料(轉載收藏)quartz
- SQL中時間函式總結(一)SQL函式
- 這五類人最適合轉Web前端,有你嗎?Web前端
- Windows 10 1903 又崩了,開始選單罷工Windows
- Quartz.Net系列(十六):Misfire策略在SimpleScheduler和CronScheduler中的使用quartz
- Web與Client是否可以完美結合(在現有技術水平下)?Webclient
- Quartz原理解密quartz解密
- Quartz 簡單使用quartz
- Quartz 2Dquartz
- iOS Quartz筆記iOSquartz筆記