1

我们有一个用java开发的应用程序(jdk1.5,DB是oracle 10g)。在某个时间点,我们的应用程序出现以下错误并终止。我在互联网上搜索过,所有论坛都说“这可能是驱动程序问题(oracle JDBC 驱动程序和 DB 之间的兼容性)。要解决这个问题,我们需要升级或者我们需要替换一些最新版本的 jar 文件”。但是,如果我重新启动我的应用程序,它就会开始正常工作。我很少收到此错误。如果这确实是驱动程序问题,那么当我重新启动我的应用程序时它应该不起作用。

我想了解它会在哪种情况下发生,因为它并非每次都发生。

谁可以帮我这个事?

来自我的应用程序的错误日志:

SQL Error: 17401, SQLState: null
Protocol violation
SQL Error: 17401, SQLState: null
Protocol violation
SQL Error: 17401, SQLState: null
Protocol violation
Rollback failed
java.sql.SQLException: Protocol violation
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.j ava:1160)
at oracle.jdbc.ttc7.Ocommoncall.receive(Ocommoncall.j ava:149)
at oracle.jdbc.ttc7.TTC7Protocol.rollback(TTC7Protoco l.java:488)
at oracle.jdbc.driver.OracleConnection.rollback(Oracl eConnection.java:1412)
at net.sf.hibernate.transaction.JDBCTransaction.rollb ack(JDBCTransaction.java:86)
at com.azure.spark.database.hibernate.util.HibernateU til.doSessionWork(HibernateUtil.java:90)
at com.azure.spark.database.hibernate.util.HibernateU til.doSessionWork(HibernateUtil.java:59)
at com.azure.spark.database.hibernate.util.HibernateU til.get(HibernateUtil.java:569)
at com.azure.spark.database.hibernate.util.HibernateS ession.get(HibernateSession.java:340)
at com.azure.spark.taskcontroller.TaskControllerCompo nent.taskCompleted(TaskControllerComponent.java:11 54)
at com.azure.spark.taskcontroller.TaskControllerCompo nent.onTaskEvent(TaskControllerComponent.java:1111 )
at com.azure.spark.taskcontroller.tasks.AbstractTaskC omponent.run(AbstractTaskComponent.java:354)
at java.lang.Thread.run(Thread.java:637)
Error rolling back transaction
net.sf.hibernate.TransactionException: Rollback failed with SQL exception: 
at net.sf.hibernate.transaction.JDBCTransaction.rollb ack(JDBCTransaction.java:91)
at com.azure.spark.database.hibernate.util.HibernateU til.doSessionWork(HibernateUtil.java:90)
at com.azure.spark.database.hibernate.util.HibernateU til.doSessionWork(HibernateUtil.java:59)
at com.azure.spark.database.hibernate.util.HibernateU til.get(HibernateUtil.java:569)
at com.azure.spark.database.hibernate.util.HibernateS ession.get(HibernateSession.java:340)
at com.azure.spark.taskcontroller.TaskControllerCompo nent.taskCompleted(TaskControllerComponent.java:11 54)
at com.azure.spark.taskcontroller.TaskControllerCompo nent.onTaskEvent(TaskControllerComponent.java:1111 )
at com.azure.spark.taskcontroller.tasks.AbstractTaskC omponent.run(AbstractTaskComponent.java:354)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.sql.SQLException: Protocol violation
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.j ava:1160)
at oracle.jdbc.ttc7.Ocommoncall.receive(Ocommoncall.j ava:149)
at oracle.jdbc.ttc7.TTC7Protocol.rollback(TTC7Protoco l.java:488)
at oracle.jdbc.driver.OracleConnection.rollback(Oracl eConnection.java:1412)
at net.sf.hibernate.transaction.JDBCTransaction.rollb ack(JDBCTransaction.java:86)
... 8 more
Error setting task status to completed
net.sf.hibernate.HibernateException: Error attempting to do session work
at com.azure.spark.database.hibernate.util.HibernateU til.doSessionWork(HibernateUtil.java:96)
at com.azure.spark.database.hibernate.util.HibernateU til.doSessionWork(HibernateUtil.java:59)
at com.azure.spark.database.hibernate.util.HibernateU til.get(HibernateUtil.java:569)
at com.azure.spark.database.hibernate.util.HibernateS ession.get(HibernateSession.java:340)
at com.azure.spark.taskcontroller.TaskControllerCompo nent.taskCompleted(TaskControllerComponent.java:11 54)
at com.azure.spark.taskcontroller.TaskControllerCompo nent.onTaskEvent(TaskControllerComponent.java:1111 )
at com.azure.spark.taskcontroller.tasks.AbstractTaskC omponent.run(AbstractTaskComponent.java:354)
at java.lang.Thread.run(Thread.java:637)
Caused by: net.sf.hibernate.exception.GenericJDBCException: could not load: [com.azure.spark.database.hibernate.mappings.refere nce.impl.TaskImpl#43176610]
at net.sf.hibernate.exception.ErrorCodeConverter.hand ledNonSpecificException(ErrorCodeConverter.java:90 )
at net.sf.hibernate.exception.ErrorCodeConverter.conv ert(ErrorCodeConverter.java:79)
at net.sf.hibernate.exception.JDBCExceptionHelper.con vert(JDBCExceptionHelper.java:30)
at net.sf.hibernate.persister.AbstractEntityPersister .convert(AbstractEntityPersister.java:1332)
at net.sf.hibernate.persister.EntityPersister.load(En tityPersister.java:418)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionIm pl.java:2130)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(Se ssionImpl.java:2027)
at net.sf.hibernate.impl.SessionImpl.get(SessionImpl. java:1936)
at com.azure.spark.database.hibernate.util.HibernateU til$11.doSessionWork(HibernateUtil.java:573)
at com.azure.spark.database.hibernate.util.HibernateU til.doSessionWork(HibernateUtil.java:80)
... 7 more
Caused by: java.sql.SQLException: Protocol violation
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.j ava:1160)
at oracle.jdbc.ttc7.Oclose.receive(Oclose.java:133)
at oracle.jdbc.ttc7.TTC7Protocol.close(TTC7Protocol.j ava:684)
at oracle.jdbc.driver.OracleStatement.close(OracleSta tement.java:700)
at oracle.jdbc.driver.OraclePreparedStatement.private Close(OraclePreparedStatement.java:489)
at oracle.jdbc.driver.OraclePreparedStatement.close(O raclePreparedStatement.java:396)
at net.sf.hibernate.impl.BatcherImpl.closePreparedSta tement(BatcherImpl.java:273)
at net.sf.hibernate.impl.BatcherImpl.closeStatement(B atcherImpl.java:141)
at net.sf.hibernate.impl.BatcherImpl.closeQueryStatem ent(BatcherImpl.java:157)
at net.sf.hibernate.impl.BatcherImpl.closeQueryStatem ent(BatcherImpl.java:104)
at net.sf.hibernate.loader.Loader.getResultSet(Loader .java:884)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java :269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializ eNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.j ava:911)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.j ava:931)
at net.sf.hibernate.loader.EntityLoader.load(EntityLo ader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLo ader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(En tityPersister.java:415)
... 12 more
4

2 回答 2

0

我将首先升级您的 JDBC 驱动程序,并在您的类路径中查找 class12.jar。我还发现此链接可能会有所帮助:https ://forums.oracle.com/message/9710491

于 2013-11-01T18:52:50.700 回答
0

我们有同样的问题。我们用 ojdbc8.jar 替换了 ojdbc7.jar,它解决了问题。我们的休眠版本是 4.x。

这是由于数据库中的 CLOB 字段引起的,其他选项是在数据中添加空格或额外字符。更多信息在这里https://community.oracle.com/thread/3647914

于 2017-04-13T21:42:05.037 回答