JDBC4通信异常

时间:2016-10-14 07:10:03

标签: mysql jdbc glassfish

我似乎遇到了问题,当我尝试写入数据库时​​,我遇到了通信异常。这似乎发生在一个不活动的perioid之后,但我不确定。

Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 40,404,396 milliseconds ago.  The last packet sent successfully to the server was 40,404,396 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.

我尝试将超时设置得更高,并将autoReconnect = true添加到连接字符串中。抛出异常时,它会重试4次,然后停止。

有趣的是,数据库与应用程序服务器位于同一服务器中。怎么会发生这种情况,我该如何解决这个问题?

我真的希望你们能帮助我!

祝你好运, 本

修改 正如所指出的,这个问题可以在多个地方看到。不幸的是,提出的解决方案对我没有帮助。他们有实际的通信故障(不在服务器上运行mysql本地)或他们用另一个连接字符串修复它。我已经尝试了所说的一切,但仍然得到了错误。 周末的最新错误显示在此处:http://pastebin.com/wMb7Ygwd

0 个答案:

没有答案