I have a jar which takes data from sql (in a loop) and puts into queue after processing it. It has been running well & good until today before started throwing Communications link failure due to underlying exception:
. & the following continued . . .
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1905) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2351) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1124) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:676) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030) at org.sun.Mailthread1.DataPush(Mailthread1.java:341) at org.sun.Mailthread1.run(Mailthread1.java:216) at java.lang.Thread.run(Thread.java:744)
** END NESTED EXCEPTION **
From little googling I understand that this could be because of dead connection (because of longer inactivity). But in my situation the program is processing a couple of rows and then throwing this exception. Every time I restart the jar and the same happens.
How can I overcome this problem/exception.