Internal Server Error: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 66,943,475 milliseconds ago. The last packet sent successfully to the server was 66,943,475 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.
Press refresh 3 or 4 times, and everything seems to wake up and the error disappears for a few days.
I've tried:
- autoReconnect = true (doesn't seem to work anyway)
- Updating to latest version of MySQL Driver
- Switching to Tomcat Container Connection Pools
- Switching to C3PO
It seemed that switching to C3PO helped for a while. I had it set to attempt to reconnect for 30 times in a row, and that seemed to work. For some reason it stopped working again.
This problem does not seem to happen on my local machine. Only on the server. I've read through 1000's of forum posts.
Tomcat 6.0.28
web.xml
<resource-ref>
<description>MySQL Datasource</description>
<res-ref-name>jdbc/sbiexam5-c3po</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
context.xml
<Resource auth="Container"
description="DB Connection"
driverClass="com.mysql.jdbc.Driver"
maxPoolSize="100"
minPoolSize="8"
name="jdbc/sbiexam5-c3po"
user="sbiexam"
password="--removed for example--"
factory="org.apache.naming.factory.BeanFactory"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
acquireRetryAttempts="30"
acquireRetryDelay="1000"
jdbcUrl="jdbc:mysql://localhost:3306/sbiexam5?autoReconnect=true">
</Resource>
Any ideas MUCH appreciated...