Jerry Malcolm
2012-01-26 15:46:38 UTC
I migrated to Tomcat 7.0 a couple of months ago on several servers. Ever
since moving to 7, I periodically get the following exception on MySql
calls on all of my 7.0 servers:
Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The
last packet successfully received from the server was 71,072,547
milliseconds ago. The last packet sent successfully to the server was
71,072,578 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.
My data source configuration is:
<Resource name="jdbc/xxxxxxxxxxxxxx.com" auth="Container"
type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
username="xxxxxxx" password="xxxxxxx"
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://
127.0.0.1/xxxxxxxxx?autoReconnect=true"/>
I realize that, yes, the 71k seconds is greater than the 10k maxWait and I
could increase maxWait. But that would not be fixing the problem. The
exception text says to use autoReconnect=true. But I already have
autoReconnect=true, and I'm certain this was working back on 5.0 (I went
from 5.0 to 7.0).
I also know I could (and probably should) add defensive code to check for
connection validity. But again, this all worked fine for years on 5.0.
It appears that autoReconnect is no longer working. Has the configuration
syntax changed for autoReconnect since 5.0?
Thx
Jerry
since moving to 7, I periodically get the following exception on MySql
calls on all of my 7.0 servers:
Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The
last packet successfully received from the server was 71,072,547
milliseconds ago. The last packet sent successfully to the server was
71,072,578 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.
My data source configuration is:
<Resource name="jdbc/xxxxxxxxxxxxxx.com" auth="Container"
type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
username="xxxxxxx" password="xxxxxxx"
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://
127.0.0.1/xxxxxxxxx?autoReconnect=true"/>
I realize that, yes, the 71k seconds is greater than the 10k maxWait and I
could increase maxWait. But that would not be fixing the problem. The
exception text says to use autoReconnect=true. But I already have
autoReconnect=true, and I'm certain this was working back on 5.0 (I went
from 5.0 to 7.0).
I also know I could (and probably should) add defensive code to check for
connection validity. But again, this all worked fine for years on 5.0.
It appears that autoReconnect is no longer working. Has the configuration
syntax changed for autoReconnect since 5.0?
Thx
Jerry