Re: IOException: failed to communicate with MySQL
Hi, as suggested in many threads in this list you´re probably dealing with mySQL driver connection timeout problem. For what you wrote, your connections are being managed by SQLManager class, so your not using Tomcat connection pooling. Tomcat DBCP provides a way to recycle broken or stale connections resulting from DB server shutdown or connections timing out. Aparently your SQLManager class is not recycling this connections. I suggest trying Tomcat DBCP, or implement connection recycling in your manager class. Hope this help. Patricio El mar, 03-06-2003 a las 04:26, Mindaugas Genutis escribió: Hello, My JSP application very often after night, in the morning stops communicating with MySQL database. I get an exception each morning (the exception body goes below). The application starts to work again after I restart it from the Tomcat Manager. Maybe someone else also had this same problem? My server configuration: Linux Redhat, Tomcat 4.1.24, Java 1.4.1. My assumptions where the problem might be: the MySQL connections are eaten by another application or they are eaten by my application somewhere inside and never closed. Or maybe during the night when no one is working with my application it somehow frozes? Can anyone give me a clue how to start debugging these early morning crashes? Another clue: Connections to the database are made through an SQLManager which is a class written by another programmer. The class is a singleton. Could it be that I have to reset it more often? The exception body goes here: java.sql.SQLException: Communication link failure: java.io.IOException at com.mysql.jdbc.MysqlIO.clearAllReceive(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQuery(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Statement.executeQuery(Unknown Source) at com.mysql.jdbc.jdbc2.Statement.executeQuery(Unknown Source) at lt.ktu.distance.sql.mysql.MySQLGUILanguageManagerHelper.loadGUILanguages(MySQLGUILanguageManagerHelper.java:48) at lt.ktu.distance.sql.GUILanguageManager.loadGUILanguages(GUILanguageManager.java:55) at org.apache.jsp.index_jsp._jspService(index_jsp.java:155) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at
RE: IOException: failed to communicate with MySQL
Yesterday, I added autoReconnect=true to the URL and I am no longer having the problems. I did not have to restart the tomcat server in the morning today. Thanks to everyone for their help. Hemendra -Original Message- From: Martin Jacobson [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 12:58 AM To: Tomcat Users List Subject: Re: IOException: failed to communicate with MySQL Mindaugas Genutis wrote: a couple of days ago a post went by talking about MySQL default timeout being set to 8 hrs for connections... betting this might be your problem... Thanks for pointing this out. I've read the thread Tomcat problems every morning. However, no solution was suggested in that thread. One can assume the solution implicitly: increase default MySQL timeout from 8 hours to say 48 hours. However, if my application stays idle for 48 hours during holidays, it will disconnect after that. Does anyone else have a suggestion on how to improve on this? Yes, add ?autoReconnect=true to the connection url. Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: IOException: failed to communicate with MySQL
a couple of days ago a post went by talking about MySQL default timeout being set to 8 hrs for connections... betting this might be your problem... -Original Message- From: Mindaugas Genutis [mailto:[EMAIL PROTECTED] Sent: Tuesday, 3 June 2003 5:26 PM To: [EMAIL PROTECTED] Subject: IOException: failed to communicate with MySQL Hello, My JSP application very often after night, in the morning stops communicating with MySQL database. I get an exception each morning (the exception body goes below). The application starts to work again after I restart it from the Tomcat Manager. Maybe someone else also had this same problem? My server configuration: Linux Redhat, Tomcat 4.1.24, Java 1.4.1. My assumptions where the problem might be: the MySQL connections are eaten by another application or they are eaten by my application somewhere inside and never closed. Or maybe during the night when no one is working with my application it somehow frozes? Can anyone give me a clue how to start debugging these early morning crashes? Another clue: Connections to the database are made through an SQLManager which is a class written by another programmer. The class is a singleton. Could it be that I have to reset it more often? The exception body goes here: java.sql.SQLException: Communication link failure: java.io.IOException at com.mysql.jdbc.MysqlIO.clearAllReceive(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQuery(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Statement.executeQuery(Unknown Source) at com.mysql.jdbc.jdbc2.Statement.executeQuery(Unknown Source) at lt.ktu.distance.sql.mysql.MySQLGUILanguageManagerHelper.loadGUILanguages(MyS QLGUILanguageManagerHelper.java:48) at lt.ktu.distance.sql.GUILanguageManager.loadGUILanguages(GUILanguageManager.j ava:55) at org.apache.jsp.index_jsp._jspService(index_jsp.java:155) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 10) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at
RE: IOException: failed to communicate with MySQL
a couple of days ago a post went by talking about MySQL default timeout being set to 8 hrs for connections... betting this might be your problem... Thanks for pointing this out. I've read the thread Tomcat problems every morning. However, no solution was suggested in that thread. One can assume the solution implicitly: increase default MySQL timeout from 8 hours to say 48 hours. However, if my application stays idle for 48 hours during holidays, it will disconnect after that. Does anyone else have a suggestion on how to improve on this? Hello, My JSP application very often after night, in the morning stops communicating with MySQL database. I get an exception each morning (the exception body goes below). The application starts to work again after I restart it from the Tomcat Manager. Maybe someone else also had this same problem? My server configuration: Linux Redhat, Tomcat 4.1.24, Java 1.4.1. My assumptions where the problem might be: the MySQL connections are eaten by another application or they are eaten by my application somewhere inside and never closed. Or maybe during the night when no one is working with my application it somehow frozes? Can anyone give me a clue how to start debugging these early morning crashes? Another clue: Connections to the database are made through an SQLManager which is a class written by another programmer. The class is a singleton. Could it be that I have to reset it more often? -- Kaunas Regional Distance Education Center Programmer Phone: +370 674 05232 WWW: http://distance.ktu.lt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IOException: failed to communicate with MySQL
Write a dbkeep-alive, schedule it to run say every 15 minutes. Works for me. I use jcrontab.sourceforge.net to schedule this. I think DBCP also does something like this, you might want to look at their docs as well. Mindaugas Genutis wrote: a couple of days ago a post went by talking about MySQL default timeout being set to 8 hrs for connections... betting this might be your problem... Thanks for pointing this out. I've read the thread Tomcat problems every morning. However, no solution was suggested in that thread. One can assume the solution implicitly: increase default MySQL timeout from 8 hours to say 48 hours. However, if my application stays idle for 48 hours during holidays, it will disconnect after that. Does anyone else have a suggestion on how to improve on this? Hello, My JSP application very often after night, in the morning stops communicating with MySQL database. I get an exception each morning (the exception body goes below). The application starts to work again after I restart it from the Tomcat Manager. Maybe someone else also had this same problem? My server configuration: Linux Redhat, Tomcat 4.1.24, Java 1.4.1. My assumptions where the problem might be: the MySQL connections are eaten by another application or they are eaten by my application somewhere inside and never closed. Or maybe during the night when no one is working with my application it somehow frozes? Can anyone give me a clue how to start debugging these early morning crashes? Another clue: Connections to the database are made through an SQLManager which is a class written by another programmer. The class is a singleton. Could it be that I have to reset it more often? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IOException: failed to communicate with MySQL
Mindaugas Genutis wrote: a couple of days ago a post went by talking about MySQL default timeout being set to 8 hrs for connections... betting this might be your problem... Thanks for pointing this out. I've read the thread Tomcat problems every morning. However, no solution was suggested in that thread. One can assume the solution implicitly: increase default MySQL timeout from 8 hours to say 48 hours. However, if my application stays idle for 48 hours during holidays, it will disconnect after that. Does anyone else have a suggestion on how to improve on this? Yes, add ?autoReconnect=true to the connection url. Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]