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

开发者社区> 问答> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

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

2016-03-10 12:04:39 5960 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
相关问答

1

回答

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

2020-05-25 15:57:38 673浏览量 回答数 1

2

回答

网站打开

2018-10-15 16:21:38 426浏览量 回答数 2

1

回答

可信网站

2018-07-15 11:39:13 519浏览量 回答数 1

1

回答

网站报500的错误

2018-06-07 05:42:54 543浏览量 回答数 1

1

回答

网站打开空白

2018-04-09 09:58:47 542浏览量 回答数 1

2

回答

我的网站出现500错误

2017-06-11 10:08:47 2004浏览量 回答数 2

2

回答

网站403

2017-03-02 19:55:25 1878浏览量 回答数 2

3

回答

为什么我的网站响应超时

2015-12-19 20:27:14 4678浏览量 回答数 3

1

回答

新网站发外链技巧

2014-05-24 14:27:43 7298浏览量 回答数 1

1

回答

网站建设空间选择问题

2013-12-26 13:53:12 6650浏览量 回答数 1
+关注
蛮大人123
我说我不帅他们就打我,还说我虚伪
文章
问答
问答排行榜
最热
最新
相关电子书
更多
附件下载测试
立即下载
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载