HTTP状态500 - 内部服务器错误 - 管道损坏

时间:2017-05-26 03:09:15

标签: java mysql apache jdbc glassfish

我是jsp& amp;的初学者java.And我开发了一个简单的Web应用程序。 当我在服务器上部署一段时间后,应用程序正常工作。 当我尝试在一段时间后运行我的Web应用程序服务器返回以下消息:

  

HTTP状态500 - 内部服务器错误

type - 异常报告

消息 - 内部服务器错误

description - 服务器遇到内部错误,导致无法完成此请求。

异常 -

javax.servlet.ServletException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 37,611,394 milliseconds ago.  The last packet sent successfully to the server was 37,611,394 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.

root cause -

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 37,611,394 milliseconds ago.  The last packet sent successfully to the server was 37,611,394 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.

root cause -

java.net.SocketException: Broken pipe

note - The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.0 logs.
GlassFish Server Open Source Edition 4.0 

(不知道出了什么问题。继续搜索谷歌但还没有运气)

1 个答案:

答案 0 :(得分:0)

可能您需要将连接URL设置为此。

jdbcUrl = jdbc:mysql://localhost:3306/yourdatabase?useUnicode=yes&characterEncoding=utf8&autoReconnect=true&verifyServerCertificate=false&useSSL=false