Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last packet sent successfully to the server was 0 milliseconds ago 保存数据的时候报这个错误 #6212

Open
alvin22 opened this issue Nov 1, 2024 · 2 comments

Comments

@alvin22
Copy link

alvin22 commented Nov 1, 2024

dbtype: mysql
dbversion: 5.7
duird version: 1.2.9
jdk version: 8

java.lang.reflect.InvocationTargetException 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 com.xxl.job.core.handler.impl.MethodJobHandler.$sw$original$execute$22702m2(MethodJobHandler.java:31) at com.xxl.job.core.handler.impl.MethodJobHandler.$sw$original$execute$22702m2$accessor$$sw$9hiudr1(MethodJobHandler.java) at com.xxl.job.core.handler.impl.MethodJobHandler$$sw$auxiliary$d23c252.call(Unknown Source) at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:86) at com.xxl.job.core.handler.impl.MethodJobHandler.execute(MethodJobHandler.java) at com.xxl.job.core.thread.JobThread.run(JobThread.java:169) Caused by: org.springframework.transaction.TransactionSystemException: JDBC commit failed; nested exception is java.sql.SQLException: connection disabled at org.springframework.jdbc.datasource.DataSourceTransactionManager.translateException(DataSourceTransactionManager.java:435) at org.springframework.jdbc.support.JdbcTransactionManager.translateException(JdbcTransactionManager.java:188) at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:336) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:654) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:407) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) at com.baomidou.dynamic.datasource.aop.DynamicDataSourceAnnotationInterceptor.invoke(DynamicDataSourceAnnotationInterceptor.java:50) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) at com.byt.bonyear.mvp.nccsync.adapter.JdbcTemplateAdapter$$EnhancerBySpringCGLIB$$b72c9f4e.saveOrUpdate() at com.byt.bonyear.mvp.service.impl.ncc.NccSyncServiceImpl.syncCbill(NccSyncServiceImpl.java:1836) at com.byt.bonyear.mvp.nccsync.job.NccJobHandler.cbillJob(NccJobHandler.java:430) ... 10 more Caused by: java.sql.SQLException: connection disabled at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection.java:1196) at com.alibaba.druid.pool.DruidPooledConnection.checkState(DruidPooledConnection.java:1181) at com.alibaba.druid.pool.DruidPooledConnection.commit(DruidPooledConnection.java:776) at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:333) ... 24 more Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) at com.mysql.cj.jdbc.StatementImpl.$sw$original$executeQuery$neca9n0(StatementImpl.java:1206) at com.mysql.cj.jdbc.StatementImpl.$sw$original$executeQuery$neca9n0$accessor$$sw$a0vgfr0(StatementImpl.java) at com.mysql.cj.jdbc.StatementImpl$$sw$auxiliary$si81kp3.call(Unknown Source) at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:86) at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java) at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2883) at com.alibaba.druid.wall.WallFilter.statement_executeQuery(WallFilter.java:571) at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2880) at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2514) at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:302) at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2880) at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.executeQuery(StatementProxyImpl.java:221) at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:308) at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:452) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:381) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:465) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:475) at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:525) at com.byt.bonyear.mvp.nccsync.adapter.JdbcTemplateAdapter.saveOrUpdate(JdbcTemplateAdapter.java:58) at com.byt.bonyear.mvp.nccsync.adapter.JdbcTemplateAdapter$$FastClassBySpringCGLIB$$abe85461.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ... 20 more Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago. at sun.reflect.GeneratedConstructorAccessor143.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) at com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:520) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:700) at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:639) at com.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:987) at com.mysql.cj.protocol.a.NativeProtocol.sendQueryString(NativeProtocol.java:933) at com.mysql.cj.NativeSession.execSQL(NativeSession.java:664) at com.mysql.cj.jdbc.StatementImpl.$sw$original$executeQuery$neca9n0(StatementImpl.java:1174) ... 45 more Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. at com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:67) at com.mysql.cj.protocol.a.SimplePacketReader.readHeaderLocal(SimplePacketReader.java:81) at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:63) at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:45) at com.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:52) at com.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:41) at com.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:54) at com.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:44) at com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:514) ... 51 more

@alvin22
Copy link
Author

alvin22 commented Nov 1, 2024

有解决办法吗,换了hikari 连接池貌似也不行。跪求帮忙

@zhangchengk
Copy link

有解决办法吗,换了hikari 连接池貌似也不行。跪求帮忙

Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago

跟druid没关系的,检查下数据库连通性

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants