【发布时间】:2017-05-26 03:09:15
【问题描述】:
我是 jsp 和 java 的初学者。我已经开发了一个简单的 Web 应用程序。 当我在服务器上部署一段时间后,应用程序运行良好。 当我在一段时间后尝试运行我的 Web 应用程序时,服务器返回以下消息:
HTTP 状态 500 - 内部服务器错误
类型 - 异常报告
消息 - 内部服务器错误
描述 - 服务器遇到一个内部错误,导致它无法完成此请求。
异常-
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
(不知道出了什么问题。仍在搜索 Google 但还没有运气)
【问题讨论】:
-
您能否向我们展示您的代码,以便我们评估问题?
-
检查数据库连接。
标签: java mysql apache jdbc glassfish