【问题标题】:HTTP Status 500 - Internal Server Error - Broken pipeHTTP 状态 500 - 内部服务器错误 - 管道损坏
【发布时间】: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


【解决方案1】:

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

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

【讨论】:

  • 为什么需要@Neeson.Z?
  • @N00bPr0grammer 来自它的异常... or using the Connector/J connection property 'autoReconnect=true' to avoid this problem...,似乎它陷入了 MySQL 的 8 小时超时问题。
猜你喜欢
  • 1970-01-01
  • 2015-03-24
  • 2019-02-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-14
  • 1970-01-01
相关资源
最近更新 更多