首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

com.mysql.jdbc.CommunicationsException这个异常是什么原因引起的

2011-12-11 
com.mysql.jdbc.CommunicationsException这个错误是什么原因引起的我用的是MYSQL+Resin程序运行了一段时间

com.mysql.jdbc.CommunicationsException这个错误是什么原因引起的
我用的是MYSQL   +Resin
程序运行了一段时间后,就偶然会报出下面的错误:
[2007-03-31   22:49:33]   com.mysql.jdbc.CommunicationsException:   Communications   link   failure   due   to   underlying   exception:  
[2007-03-31   22:49:33]  
[2007-03-31   22:49:33]   **   BEGIN   NESTED   EXCEPTION   **  
[2007-03-31   22:49:33]  
[2007-03-31   22:49:33]   java.io.EOFException
[2007-03-31   22:49:33]  
[2007-03-31   22:49:33]   STACKTRACE:
[2007-03-31   22:49:33]  
[2007-03-31   22:49:33]   java.io.EOFException
[2007-03-31   22:49:33]       at   com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
[2007-03-31   22:49:33]       at   com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[2007-03-31   22:49:33]       at   com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[2007-03-31   22:49:33]       at   ayou.db.BASE.getDataWithException(BASE.java:301)
[2007-03-31   22:49:33]       at   ayou.db.BASE.getData(BASE.java:274)
[2007-03-31   22:49:33]       at   com.tom.tech.cms.analytics.ArticleIndexdb.getNewListAll(ArticleIndexdb.java:42)
[2007-03-31   22:49:33]       at   com.tom.tech.cms.analytics.BackupActicle.getNewList(BackupActicle.java:46)
[2007-03-31   22:49:33]       at   com.tom.tech.cms.analytics.BackupActicle.setAllNewList(BackupActicle.java:60)
[2007-03-31   22:49:33]       at   _jsp._analytics._test__jsp._jspService(_test__jsp.java:41)
[2007-03-31   22:49:33]       at   com.caucho.jsp.JavaPage.service(JavaPage.java:60)
[2007-03-31   22:49:33]       at   com.caucho.jsp.Page.pageservice(Page.java:570)
[2007-03-31   22:49:33]       at   com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:179)
[2007-03-31   22:49:33]       at   com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
[2007-03-31   22:49:33]       at   com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
[2007-03-31   22:49:33]       at   com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:420)
[2007-03-31   22:49:33]       at   com.caucho.server.port.TcpConnection.run(TcpConnection.java:511)
[2007-03-31   22:49:33]       at   com.caucho.util.ThreadPool.runTasks(ThreadPool.java:520)
[2007-03-31   22:49:33]       at   com.caucho.util.ThreadPool.run(ThreadPool.java:442)


[2007-03-31   22:49:33]       at   java.lang.Thread.run(Thread.java:595)
[2007-03-31   22:49:33]  
[2007-03-31   22:49:33]  
[2007-03-31   22:49:33]   **   END   NESTED   EXCEPTION   **
[2007-03-31   22:49:33]  
[2007-03-31   22:49:33]  
[2007-03-31   22:49:33]  
[2007-03-31   22:49:33]   Last   packet   sent   to   the   server   was   1   ms   ago.
[2007-03-31   22:49:33]       at   com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2515)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
[2007-03-31   22:49:33]       at   com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
[2007-03-31   22:49:33]       at   com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[2007-03-31   22:49:33]       at   com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[2007-03-31   22:49:33]       at   ayou.db.BASE.getDataWithException(BASE.java:301)
[2007-03-31   22:49:33]       at   ayou.db.BASE.getData(BASE.java:274)
[2007-03-31   22:49:33]       at   com.tom.tech.cms.analytics.ArticleIndexdb.getNewListAll(ArticleIndexdb.java:42)
[2007-03-31   22:49:33]       at   com.tom.tech.cms.analytics.BackupActicle.getNewList(BackupActicle.java:46)
[2007-03-31   22:49:33]       at   com.tom.tech.cms.analytics.BackupActicle.setAllNewList(BackupActicle.java:60)
[2007-03-31   22:49:33]       at   _jsp._analytics._test__jsp._jspService(_test__jsp.java:41)
[2007-03-31   22:49:33]       at   com.caucho.jsp.JavaPage.service(JavaPage.java:60)
[2007-03-31   22:49:33]       at   com.caucho.jsp.Page.pageservice(Page.java:570)
[2007-03-31   22:49:33]       at   com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:179)
[2007-03-31   22:49:33]       at   com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
[2007-03-31   22:49:33]       at   com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
[2007-03-31   22:49:33]       at   com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:420)
[2007-03-31   22:49:33]       at   com.caucho.server.port.TcpConnection.run(TcpConnection.java:511)
[2007-03-31   22:49:33]       at   com.caucho.util.ThreadPool.runTasks(ThreadPool.java:520)
[2007-03-31   22:49:33]       at   com.caucho.util.ThreadPool.run(ThreadPool.java:442)
[2007-03-31   22:49:33]       at   java.lang.Thread.run(Thread.java:595)
请问这是怎么会事啊,是什么原因引起的
为什么有时候会报,有时候又正常了呢?

[解决办法]
在mysql关闭连接之前关闭自己持有的链接
------解决方案--------------------


我也遇到同样的问题 ,束手无策
[解决办法]
我也是遇到了这个问题,唯一的办法是先重新启动服务器了!
呵呵
8h后启动一次,晕死了

[解决办法]
难道是Resin对连接池支持不好?

热点排行