I have installed tomcat on centos and deployed a java web application. I'm using mysql db. Everyday in the morning when I try to login as first user, it gieves me the following error:
Your login attempt was not successful, try again. Reason: org.hibernate.exception.JDBCConnectionException: The last packet successfully received from the server was 66,913,221 milliseconds ago. The last packet sent successfully to the server was 66,913,221 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.
After this, When I try to relogin, it allows me to do so.
I have include the following in my context.xml
<Resource name="jdbc/CAR" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="30000"
username="root" password="" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://130.1.18.2:3306/car" validationQuery="SELECT 1" testOnBorrow = true/>
Any help on this, I would appreciate. Thanks