Description:
If I leave my web-application running for over two weeks, I will get the following error:
java.sql.SQLException: Communication failure during handshake. Is there a server running on [server]:3306?
I have only found a couple of other reports similar to this as I searched on google for mysql errors. One person noted (last april) that they thought they fixed it by upgrading the connector j driver.
I am running a j2ee web application on apache/tomcat and using mysql as my database. I have verified that I don't have any connection leaks. The following is the full stack trace:
java.sql.SQLException: Communication failure during handshake. Is there a server running on [server]:3306?
at com.mysql.jdbc.MysqlIO.init(Unknown Source)
at com.mysql.jdbc.Connection.connectionInit(Unknown Source)
at com.mysql.jdbc.jdbc2.Connection.connectionInit(Unknown Source)
at com.mysql.jdbc.Driver.connect(Unknown Source)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(Unknown Source)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(Unknown Source)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(Unknown Source)
at com.simplysharp.db.Manager.open(Unknown Source)
at com.simplysharp.db.Manager.loadVector(Unknown Source)
at com.simplysharp.db.Manager.loadVector(Unknown Source)
at com.simplysharp.db.BookManager.loadVector(Unknown Source)
at com.simplysharp.db.Cache.loadBooks(Unknown Source)
at com.simplysharp.salon.plugin.DBPlugIn.loadCache(Unknown Source)
at com.simplysharp.salon.plugin.DBPlugIn.init(Unknown Source)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:924)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3341)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:257)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:410)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:368)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
How to repeat:
This seems to happen when I haven't restarted the web application for 2+ weeks. The other user I found with a similar issue, that seemed to be related to time: http://www.geocrawler.com/archives/3/193/2002/4/0/8536949/