网站如果第一次打开都500错误刷新一下就好了不知道为什么-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

网站如果第一次打开都500错误刷新一下就好了不知道为什么

2016-03-10 12:04:39 5279 1

java EE 网站如果第一次打开都500错误,刷新一下就好了,不知道为什么

HTTP Status 500 - Request processing failed; nested exception is org.springframework.dao.RecoverableDataAccessException: PreparedStatementCallback; SQL [SELECT * FROM dt_pin WHERE deleting = 0 AND is_private = 0 AND pin_id < ? ORDER BY pin_id DESC LIMIT ?]; Communications link failure

type Exception report

message Request processing failed; nested exception is org.springframework.dao.RecoverableDataAccessException: PreparedStatementCallback; SQL [SELECT * FROM dt_pin WHERE deleting = 0 AND is_private = 0 AND pin_id < ? ORDER BY pin_id DESC LIMIT ?]; Communications link failure

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.RecoverableDataAccessException: PreparedStatementCallback; SQL [SELECT * FROM dt_pin WHERE deleting = 0 AND is_private = 0 AND pin_id < ? ORDER BY pin_id DESC LIMIT ?]; Communications link failure

The last packet successfully received from the server was 33,234,866 milliseconds ago.  The last packet sent successfully to the server was 3 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 33,234,866 milliseconds ago.  The last packet sent successfully to the server was 3 milliseconds ago.
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause

org.springframework.dao.RecoverableDataAccessException: PreparedStatementCallback; SQL [SELECT * FROM dt_pin WHERE deleting = 0 AND is_private = 0 AND pin_id < ? ORDER BY pin_id DESC LIMIT ?]; Communications link failure

The last packet successfully received from the server was 33,234,866 milliseconds ago.  The last packet sent successfully to the server was 3 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 33,234,866 milliseconds ago.  The last packet sent successfully to the server was 3 milliseconds ago.
    org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:98)
    org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
    org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:645)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:777)
    com.zhongshanwang.dao.impl.PinDaoImpl.getPinsByMax(PinDaoImpl.java:115)
    com.zhongshanwang.service.impl.PinServiceImpl.getPinsByMax(PinServiceImpl.java:190)
    com.zhongshanwang.service.impl.PinServiceImpl.pageAll(PinServiceImpl.java:901)
    sun.reflect.GeneratedMethodAccessor1467.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:497)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    com.sun.proxy.$Proxy20.pageAll(Unknown Source)
    com.zhongshanwang.controller.AllController.all(AllController.java:67)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:497)
    org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
    org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
    org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 33,234,866 milliseconds ago.  The last packet sent successfully to the server was 3 milliseconds ago.
    sun.reflect.GeneratedConstructorAccessor433.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
    com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:983)
    com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3457)
    com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3357)
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3797)
    com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470)
    com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617)
    com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2550)
    com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
    com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1962)
    com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:379)
    org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:688)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:777)
    com.zhongshanwang.dao.impl.PinDaoImpl.getPinsByMax(PinDaoImpl.java:115)
    com.zhongshanwang.service.impl.PinServiceImpl.getPinsByMax(PinServiceImpl.java:190)
    com.zhongshanwang.service.impl.PinServiceImpl.pageAll(PinServiceImpl.java:901)
    sun.reflect.GeneratedMethodAccessor1467.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:497)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    com.sun.proxy.$Proxy20.pageAll(Unknown Source)
    com.zhongshanwang.controller.AllController.all(AllController.java:67)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:497)
    org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
    org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
    org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause

java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
    com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2949)
    com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3367)
    com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3357)
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3797)
    com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470)
    com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617)
    com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2550)
    com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
    com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1962)
    com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:379)
    org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:688)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:777)
    com.zhongshanwang.dao.impl.PinDaoImpl.getPinsByMax(PinDaoImpl.java:115)
    com.zhongshanwang.service.impl.PinServiceImpl.getPinsByMax(PinServiceImpl.java:190)
    com.zhongshanwang.service.impl.PinServiceImpl.pageAll(PinServiceImpl.java:901)
    sun.reflect.GeneratedMethodAccessor1467.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:497)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    com.sun.proxy.$Proxy20.pageAll(Unknown Source)
    com.zhongshanwang.controller.AllController.all(AllController.java:67)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:497)
    org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
    org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
    org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.29 logs.

Apache Tomcat/8.0.29
取消 提交回答
全部回答(1)
  • 蛮大人123
    2019-07-17 18:57:25

    数据库休眠了,有个唤醒时间。我看你用C3P0链接池,试试这个两个配置
    ` 120 property>
    `

    0 0
相关问答

40

回答

[@徐雷frank][¥20]什么是JAVA的平台无关性

大河人家 2018-10-29 23:55:20 144697浏览量 回答数 40

162

回答

惊喜翻倍:免费ECS+免费环境配置~!(ECS免费体验6个月活动3月31日结束)

豆妹 2014-10-29 17:52:21 226083浏览量 回答数 162

145

回答

【新手入门】云服务器linux使用手册

fanyue88888 2012-11-26 17:14:18 157652浏览量 回答数 145

8

回答

OceanBase 使用动画(持续更新)

mq4096 2019-02-20 17:16:36 336968浏览量 回答数 8

13

回答

[@饭娱咖啡][¥20]我想知道 Java 关于引用那一块的知识

心意乱 2018-10-31 18:44:12 142445浏览量 回答数 13

110

回答

OSS存储服务-客户端工具

newegg11 2012-05-17 15:37:18 295465浏览量 回答数 110

22

回答

爬虫数据管理【问答合集】

我是管理员 2018-08-10 16:37:41 147210浏览量 回答数 22

18

回答

阿里云开放端口权限

xcxx 2016-07-20 15:03:33 646712浏览量 回答数 18

31

回答

[@倚贤][¥20]刚学完html/css/js的新手学习servlet、jsp需要注意哪些问题?

弗洛伊德6 2018-10-27 21:52:43 146020浏览量 回答数 31

249

回答

阿里云LNAMP(Linux + Nginx + Apache + MySQL + PHP)环境一键安装脚本

云代维 2014-02-14 15:26:06 305580浏览量 回答数 249
+关注
蛮大人123
我说我不帅他们就打我,还说我虚伪
0
文章
7733
问答
问答排行榜
最热
最新
相关电子书
更多
《Nacos架构&原理》
立即下载
《看见新力量:二》电子书
立即下载
云上自动化运维(CloudOps)白皮书
立即下载