Daniel Infante
Daniel Infante

Reputation: 41

Apache Tomcat reboot. Could not load com.mysql.jdbc.SQLError

I use Apache Tomcat 7.0 with connection-pooling in Spring Source and Hibernate POJO's. Always that I reboot Tomcat I have the following error:

03-dic-2013 9:33:46 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Acceso ilegal: esta instancia de aplicación web ya ha sido parada.  Could not load com.mysql.jdbc.SQLError.  La eventual traza de pila que sigue ha sido motivada por un error lanzado con motivos de depuración así como para intentar terminar el hilo que motivó el acceso ilegal y no tiene impacto funcional.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1600)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3321)
    at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1667)
    at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4322)
    at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1348)
    at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2679)
    at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
    at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
    at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)

Do you know how I can fix it?

Thanks a lot.

Upvotes: 1

Views: 4364

Answers (1)

Kevin
Kevin

Reputation: 86

Have you closed your connection before rebooting? If you haven't it could reach your maximum allowed connections in database settings if you keep making new connections.

 Connection con;
 try {
 con = ...; // open connection    
catch (SQLException e) {
// do stuff with your connection
 } finally {
 if (con != null && !con.isClosed()) {
    try {
        con.close();
    catch (SQLException e) {
        log.error("Failed to close connection", e);
    }
  }
}

Upvotes: 1

Related Questions