2017-05-26 144 views
0

我是jsp的初学者& java.And我开发了一个简单的Web应用程序。 当我在服务器上部署一段时间时,应用程序正常工作。 当我尝试了一段时间服务器返回下列消息后运行我的Web应用程序:HTTP状态500 - 内部服务器错误 - 损坏的管道

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

型 - 异常报告

消息 - 内部服务器错误

说明 - 服务器遇到内部错误,无法完成此请求。

exception-

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 

(不知道哪里出了问题.Still谷歌搜索,但没有运气还)

+1

你能告诉我们你的代码,以便我们可以评估这个问题吗? –

+0

检查数据库连接。 – lvxinrong

+0

[com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:通信链接失败]的可能重复(https://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link- fai) –

回答

0

可能需要在您连接的URL设置为这个。

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

为什么需要@ Neeson.Z? –

+0

@ N00bPr0grammer从它的异常'...或使用连接器/ J连接属性'autoReconnect = true'来避免这个问题...',它好像落入MySQL的8小时超时问题。 –