您好 我通过使用JSP和MySql开发了一个Web应用程序。这是一个通信链接失败错误。我尝试了我的知识,但我没有解决。请帮助他并给出解决方案。
平台:Linux S / w:java 1.5.0 服务器:apache tomcat 5.5.9 DB:mysql-connector-java-5.0.5.jar
堆栈跟踪:
java.sql.SQLException:通信链接失败:java.io.EOFException,底层原因:null
**开始没有异常**
java.io.EOFException的
堆栈跟踪:
java.io.EOFException的 在com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1395) 在com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1539) 在com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1930) 在com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1168) 在com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1279) 在com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1225) 在com.mysql.jdbc.Connection.execSQL(Connection.java:2278) 在com.mysql.jdbc.Connection.execSQL(Connection.java:2237) 在com.mysql.jdbc.Connection.execSQL(Connection.java:2218) 在com.mysql.jdbc.Connection.setAutoCommit(Connection.java:548) at cafe.admanya.data.ConnectionPool.getUserConnection(ConnectionPool.java:16) at cafe.admanya.product.ProductData.getProductDetails(ProductData.java:31) 在org.apache.jsp.productDetails_jsp._jspService(productDetails_jsp.java:74) 在org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 在org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) 在org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) 在org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461) 在org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:399) 在org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:183) 在org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:125) 在org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) 在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) 在org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200) 在org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) 在org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775) 在org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704) 在org.apache.jk.common.ChannelSocket $ SocketConnection.runIt(ChannelSocket.java:897) at org.apache.tomcat.util.threads.ThreadPool $ ControlRunnable.run(ThreadPool.java:689) 在java.lang.Thread.run(Thread.java:595)
**结束了例外**
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1714)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1930)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1168)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1279)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1225)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2278)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2237)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2218)
at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:548)
at cafe.admanya.data.ConnectionPool.getUserConnection(ConnectionPool.java:16)
at cafe.admanya.product.ProductData.getProductDetails(ProductData.java:31)
at org.apache.jsp.productDetails_jsp._jspService(productDetails_jsp.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:399)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:183)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:125)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
**结束了例外**
答案 0 :(得分:1)
我认为这意味着您的servlet与MySQL数据库的JDBC连接已经关闭。您的应用程序需要丢弃它并打开一个新的。