tomcat 关闭时报异常:
Feb 23, 2012 8:06:54 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load org.hsqldb.lib.LongKeyHashMap$Values. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
原因:内存库没有关闭。
方法:在监听里contextDestroyed()方法里写
Connection conn = null;
try {
Class.forName("org.hsqldb.jdbcDriver");
conn = DriverManager.getConnection("jdbc:hsqldb:mem:db", "sa", "");
Statement stmt = conn.createStatement();
stmt.execute("SHUTDOWN;");
conn.close();
} catch (Exception e) {
// do nothing
}