how to handle java.lang.AbstractMethodError: com.mysql.jdbc.JDBC4CallableStatement.closeOnCompletion()
<p>I am using mysql-connector-java-5.1.20-bin.jar with jdk7 and tomcat7 but my code is giving abstractMethodError while executing callableStatement.closeOnCompletion().Code is given below : </p>

<p>try {</p>

<pre><code>    Session session = HibernateUtil.currentSession();
    CallableStatement st = session.connection().prepareCall(
    "{call getOfflineNodes('" + strDevice + "',"
    + System.currentTimeMillis() + "," + polltime + ","+ status + ")}");
    ResultSet rs = st.executeQuery();
    Transaction tx = session.beginTransaction();
    st.closeOnCompletion();
    tx.commit();
    HibernateUtil.closeSession();
    return rs;
}
</code></pre>

<p>and complete exception is : </p>

<pre><code>java.lang.AbstractMethodError: com.mysql.jdbc.JDBC4CallableStatement.closeOnCompletion()V
at com.clearcube.util.DMLLayer.getOfflineNodes(DMLLayer.java:90)
at com.clearcube.logging.ShutBladeAlertService.&lt;init&gt;(ShutBladeAlertService.java:80)
at com.clearcube.common.CMSServiceLoaderServlet.init(CMSServiceLoaderServlet.java:95)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
</code></pre>

<p>can anybody tell me why this exception is coming and how to handle this.</p>

<p>code where i am using this returned resultSet is :</p>

<pre><code>timer.scheduleAtFixedRate(new TimerTask() {
          public void run()
          {
            String bladeMacs = "";
            String vmMacs = "";
            try
            {
              int poll = Integer.parseInt(
                ServerConfigurationService.getProperty("blade.refresh.time"));

              Calendar callendar = Calendar.getInstance();

              String strblade = "";
              String strvm = "";
              String Ip = "";
              ResultSet BladeRs = (ResultSet)DMLLayer.getOfflineNodes(
                "Blade", poll, 1);
              if (BladeRs != null) {
                boolean isBladeAlive = false;
                int x = 0;
                try {
                  while (BladeRs.next()) {

                    String mac = BladeRs.getString("macAddress");
                    String ip = BladeRs.getString("Ip");
                    isBladeAlive = 
                      EchoUDPClientDiscoveryObjectResponse.echo(InetAddress.getByName(BladeRs
                      .getString("Ip")), 6502, "any", 
                      3, 500);

                    if (!isBladeAlive) {

                      if (x &gt; 0)
                      {
                        strblade = strblade + "\n";
                        bladeMacs = bladeMacs + "\n";
                      }

                      strblade = strblade + ip;
                      x = 2;
                      bladeMacs = bladeMacs + mac;
                    }
                    else
                    {
                        String query = "update DiscoveredNode set DateModified=:DateModified where MacAddress=:MacAddress";

                      ShutBladeAlertService.objTypeVector.removeAllElements();
                      ShutBladeAlertService.objFieldVector.removeAllElements();
                      ShutBladeAlertService.objValueVector.removeAllElements();

                      ShutBladeAlertService.objTypeVector.add("Long");
                      ShutBladeAlertService.objFieldVector.add("DateModified");
                      ShutBladeAlertService.objValueVector.add(
                        Long.valueOf(System.currentTimeMillis()));
                      ShutBladeAlertService.objTypeVector.add("String");
                      ShutBladeAlertService.objFieldVector.add("MacAddress");
                      ShutBladeAlertService.objValueVector.add(mac);

                      DMLLayer.runUpdateQuery(query, 
                        ShutBladeAlertService.objFieldVector, ShutBladeAlertService.objValueVector, 
                        ShutBladeAlertService.objTypeVector);
                    }
                  }

                  BladeRs.close();

                }
                catch (Exception ex1) {
                  ex1.printStackTrace();
                }

              }
          }
      }
</code></pre>

<p>Thanks in advance.</p>
