org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Unexpected exception encountered during query.
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:245) ~[spring-jdbc-4.1.3.RELEASE.jar:4.1.3.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) ~[spring-tx-4.1.3.RELEASE.jar:4.1.3.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:439) ~[spring-tx-4.1.3.RELEASE.jar:4.1.3.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) ~[spring-tx-4.1.3.RELEASE.jar:4.1.3.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.1.3.RELEASE.jar:4.1.3.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.3.RELEASE.jar:4.1.3.RELEASE]
at com.sf.mdmtrm.framework.aop.SgsMethodInterceptor.invoke(SgsMethodInterceptor.java:72) ~[dds-mdmtrm-integration-1.0.12.jar:?]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.3.RELEASE.jar:4.1.3.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.1.3.RELEASE.jar:4.1.3.RELEASE]
at com.sun.proxy.$Proxy92.isBrach(Unknown Source) ~[?:?]
at com.sf.sgs.o2o.tms.manager.service.TmsTaskServiceImpl.updateFlow(TmsTaskServiceImpl.java:521) ~[o2o-dds-tms-service-1.0.12.jar:?]
at com.sf.sgs.o2o.tms.manager.service.TmsTaskServiceImpl.updateTaskStatus(TmsTaskServiceImpl.java:436) [o2o-dds-tms-service-1.0.12.jar:?]
at com.sf.sgs.o2o.tms.manager.kafka.consumer.handover.NoScheduleTaskHandler.callUpdateTaskStatus(NoScheduleTaskHandler.java:311) [o2o-dds-tms-service-1.0.12.jar:?]
at com.sf.sgs.o2o.tms.manager.kafka.consumer.handover.NoScheduleTaskHandler.taskHandover(NoScheduleTaskHandler.java:221) [o2o-dds-tms-service-1.0.12.jar:?]
at com.sf.sgs.o2o.tms.manager.kafka.consumer.handover.NoScheduleTaskHandler.handler(NoScheduleTaskHandler.java:87) [o2o-dds-tms-service-1.0.12.jar:?]
at com.sf.sgs.o2o.tms.manager.kafka.consumer.SGSHandoverInfoMsgConsumer.onMessage(SGSHandoverInfoMsgConsumer.java:80) [o2o-dds-tms-service-1.0.12.jar:?]
at com.sf.kafka.api.consume.KafkaConsumer$ConsumeTask.run(KafkaConsumer.java:230) [sf-kafka-api-core-1.11.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_25]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
Caused by: java.sql.SQLException: Unexpected exception encountered during query.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2563) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:4846) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.alibaba.druid.pool.DruidPooledConnection.setAutoCommit(DruidPooledConnection.java:709) ~[druid-1.0.31.jar:1.0.31]
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:225) ~[spring-jdbc-4.1.3.RELEASE.jar:4.1.3.RELEASE]
... 21 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 8
at com.mysql.jdbc.Buffer.readInt(Buffer.java:296) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.MysqlIO.unpackField(MysqlIO.java:688) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:415) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2997) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2245) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2638) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:4846) ~[mysql-connector-java-5.1.34.jar:5.1.34]
at com.alibaba.druid.pool.DruidPooledConnection.setAutoCommit(DruidPooledConnection.java:709) ~[druid-1.0.31.jar:1.0.31]
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:225) ~[spring-jdbc-4.1.3.RELEASE.jar:4.1.3.RELEASE]
... 21 more
2条答案
按热度按时间qvtsj1bj1#
看上去是mysql驱动版本的问题,你更换mysql driver的版本试试看
z8dt9xmd2#
后来换了驱动以后好了吗?怎么看出来是驱动的问题呢?