Hello,

 I'm having a problem with my connections to the mysql server that are 
timing out(and get the communicationsException). We use 
autoreconnect=true when creating the connections, the problem is that 
whole application is crashing at this point because the connection has 
been lost. The Dao's just create one connection at startup for all 
clients (that should stay open). Does somebody has experience with this 
problem or any advice how to keep the connections open?

Here is the stacktrace

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications 
link failure
Last packet sent to the server was 19 ms ago.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at 
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3009)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2895)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3438)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
        at 
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761)
        at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1912)
        at 
com.dnxlive.cammer.remoting.CammerService.getShortcuts(CammerService.java:86)
        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:597)
        at 
flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)
        at 
flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
        at 
flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)
        at 
flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)
        at 
flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
        at 
flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
        at 
flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
        at 
flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
        at 
flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
        at 
flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)
        at 
flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:322)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:168)
        at 
com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
        at 
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
        at 
com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
        at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2452)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2906)
        ... 36 more

Thanks in advance!
Ward Loockx

Reply via email to