com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,131,952 milliseconds ago. The last packet sent successfully to the server was 63,131,952 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

AppFuse JIRA | J. Garcia | 5 years ago
  1. 0

    We are seeing occasionally these errors. See stacktrace at the end. In order to avoid this, from what I've seen in stackoverflow, it is enough to add a couple lines to applicacionContext-esources.xml, remaining like this: <property name="defaultAutoCommit" value="true"/> <property name="validationQuery" value="SELECT 1+1"/> <property name="testOnBorrow" value="true"/> </bean> Maybe it should be there upfront, to avoid having to fix it :-) com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,131,952 milliseconds ago. The last packet sent successfully to the server was 63,131,952 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3348) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1967) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5022) at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371) at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371) at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:328) at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:87) ... 59 more Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3329) ... 67 more

    AppFuse JIRA | 5 years ago | J. Garcia
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,131,952 milliseconds ago. The last packet sent successfully to the server was 63,131,952 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
  2. 0

    We are seeing occasionally these errors. See stacktrace at the end. In order to avoid this, from what I've seen in stackoverflow, it is enough to add a couple lines to applicacionContext-esources.xml, remaining like this: <property name="defaultAutoCommit" value="true"/> <property name="validationQuery" value="SELECT 1+1"/> <property name="testOnBorrow" value="true"/> </bean> Maybe it should be there upfront, to avoid having to fix it :-) com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,131,952 milliseconds ago. The last packet sent successfully to the server was 63,131,952 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3348) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1967) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5022) at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371) at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371) at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:328) at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:87) ... 59 more Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3329) ... 67 more

    AppFuse JIRA | 5 years ago | J. Garcia
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,131,952 milliseconds ago. The last packet sent successfully to the server was 63,131,952 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
  3. 0

    Elastic Beanstalk -> RDS connection error using Grails

    Stack Overflow | 6 years ago | Jon
    org.hibernate.TransactionException: JDBC begin failed:
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JDBC connection timeout cannot reconnect

    Stack Overflow | 2 years ago | Stephane Eybert
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,313,144 milliseconds ago. The last packet sent successfully to the server was 63,313,144 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
  6. 0

    How to handle Broken pipe error with Spring, (JPA) Hibernate, MySQL

    Stack Overflow | 2 years ago | LeNoob
    javax.persistence.PersistenceException: org.hibernate.TransactionException: JDBC begin transaction failed:

  1. mauritius 2 times, last 9 months ago
  2. kuldeep 4 times, last 2 months ago
  3. esaar 1 times, last 4 months ago
16 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.SocketException

    Broken pipe

    at java.net.SocketOutputStream.socketWrite0()
  2. Java RT
    BufferedOutputStream.flush
    1. java.net.SocketOutputStream.socketWrite0(Native Method)
    2. java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    3. java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    4. java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    5. java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    5 frames
  3. MySQL jdbc
    MysqlIO.send
    1. com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3329)
    1 frame
  4. Java RT
    Constructor.newInstance
    1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    4. java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    4 frames
  5. MySQL jdbc
    ConnectionImpl.setAutoCommit
    1. com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
    2. com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
    3. com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3348)
    4. com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1967)
    5. com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
    6. com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
    7. com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5022)
    7 frames
  6. Commons DBCP
    PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit
    1. org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371)
    2. org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371)
    3. org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:328)
    3 frames
  7. Hibernate
    JDBCTransaction.begin
    1. org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:87)
    1 frame