启动没错误,但是当你进入页面的时候经常出现以下错误,但是你刷新页面就好了,过几分钟再点页面上其他链接又出现以下错误,不知道怎么回事在tomcat上报这种错误,不知道是什么原因,用本地数据库没问题,用新网J500虚拟主机的时候出现这种错误,搞了几天都没搞好,不知道问题出在哪...Struts Problem ReportStruts has detected an unhandled exception:Messages:
Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
Communications link failure The last packet successfully received from the server was 1,618,761 milliseconds ago. The last packet sent successfully to the server was 22 milliseconds ago.
could not execute query
could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query
File: com/mysql/jdbc/MysqlIO.java
Line number: 2,540
org.springframework.dao.DataAccessResourceFailureException: could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:627)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
org.gary.core.factories.impl.BasicDaoFactoryImpl.list(BasicDaoFactoryImpl.java:111)
org.gary.core.factories.impl.BasicServiceFactoryImpl.list(BasicServiceFactoryImpl.java:66)
org.gary.product.service.impl.ProductServiceImpl.getProductList(ProductServiceImpl.java:79)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy20.getProductList(Unknown Source)
org.hibernate.exception.JDBCConnectionException: could not execute query
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.loader.Loader.doList(Loader.java:2536)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
org.hibernate.loader.Loader.list(Loader.java:2271)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
org.gary.core.factories.impl.BasicDaoFactoryImpl$4.doInHibernate(BasicDaoFactoryImpl.java:118)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
org.gary.core.factories.impl.BasicDaoFactoryImpl.list(BasicDaoFactoryImpl.java:111)
org.gary.core.factories.impl.BasicServiceFactoryImpl.list(BasicServiceFactoryImpl.java:66)
com.mysql.jdbc.CommunicationsException: Communications link failure The last packet successfully received from the server was 1,618,761 milliseconds ago. The last packet sent successfully to the server was 22 milliseconds ago.
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1112)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3090)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2979)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3520)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2281)
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
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:2540)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2990)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2979)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3520)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2281)
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
org.hibernate.loader.Loader.doQuery(Loader.java:802)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
org.hibernate.loader.Loader.doList(Loader.java:2533)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
org.hibernate.loader.Loader.list(Loader.java:2271)
Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
Communications link failure The last packet successfully received from the server was 1,618,761 milliseconds ago. The last packet sent successfully to the server was 22 milliseconds ago.
could not execute query
could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query
File: com/mysql/jdbc/MysqlIO.java
Line number: 2,540
org.springframework.dao.DataAccessResourceFailureException: could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:627)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
org.gary.core.factories.impl.BasicDaoFactoryImpl.list(BasicDaoFactoryImpl.java:111)
org.gary.core.factories.impl.BasicServiceFactoryImpl.list(BasicServiceFactoryImpl.java:66)
org.gary.product.service.impl.ProductServiceImpl.getProductList(ProductServiceImpl.java:79)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy20.getProductList(Unknown Source)
org.hibernate.exception.JDBCConnectionException: could not execute query
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.loader.Loader.doList(Loader.java:2536)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
org.hibernate.loader.Loader.list(Loader.java:2271)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
org.gary.core.factories.impl.BasicDaoFactoryImpl$4.doInHibernate(BasicDaoFactoryImpl.java:118)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
org.gary.core.factories.impl.BasicDaoFactoryImpl.list(BasicDaoFactoryImpl.java:111)
org.gary.core.factories.impl.BasicServiceFactoryImpl.list(BasicServiceFactoryImpl.java:66)
com.mysql.jdbc.CommunicationsException: Communications link failure The last packet successfully received from the server was 1,618,761 milliseconds ago. The last packet sent successfully to the server was 22 milliseconds ago.
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1112)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3090)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2979)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3520)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2281)
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
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:2540)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2990)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2979)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3520)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2281)
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
org.hibernate.loader.Loader.doQuery(Loader.java:802)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
org.hibernate.loader.Loader.doList(Loader.java:2533)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
org.hibernate.loader.Loader.list(Loader.java:2271)
解决方案 »
- c.tld 文件
- servlet的菜鸟问题
- prototype验证checkbox问题
- 崩溃中....局域网 session 混乱
- 看看一段jsp登录代码
- 请教如何通过response或request从新定义下一个jsp要显示到的target?
- 只有把jsp放在jsp-example下才能显示正常
- equals 返回值为 false
- 关于用<jsp:useBean id="userBean" scope="request" ……的问题。高分!在线等待
- 请问怎样在Tomcat中发布Servlet程序?谢谢
- 学习struts2时碰到的问题,JAR包放进MyWeb/WEB-INF/lib下面不认?
- js的disabled属性兼容问题
当连接池没有销毁掉空闲时间超过设置的连接,这些连接会因为已被数据库关闭而导致失效。
2. 有可能驱动版本有问题。看看下列说明:
1. http://www.dangkai.com/ArticlePage/Article30149.htm2. http://hi.baidu.com/mengle131/blog/item/9d8de7b464f62d768ad4b27c.html