下面这个日志是,Tomcat关闭之后,报的一些异常log
25-Sep-2018 17:44:28.452 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [Backend] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
25-Sep-2018 17:44:28.453 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [Backend] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
25-Sep-2018 17:44:28.453 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
25-Sep-2018 17:44:28.456 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
25-Sep-2018 17:44:28.457 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-2] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
25-Sep-2018 17:44:28.457 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-3] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
25-Sep-2018 17:44:28.457 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-4] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
25-Sep-2018 17:44:28.458 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-5] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
25-Sep-2018 17:44:28.458 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-6] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
25-Sep-2018 17:44:28.458 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-7] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
25-Sep-2018 17:44:28.459 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-8] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
java.net.Socket.connect(Socket.java:589)
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:213)
com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:297)
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2232)
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
sun.reflect.GeneratedConstructorAccessor35.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
java.sql.DriverManager.getConnection(DriverManager.java:664)
java.sql.DriverManager.getConnection(DriverManager.java:247)
org.nutz.dao.impl.SimpleDataSource.getConnection(SimpleDataSource.java:42)
org.nutz.trans.Trans.getConnectionAuto(Trans.java:263)
org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:106)
org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:187)
org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:178)
org.nutz.dao.impl.NutDao.<init>(NutDao.java:104)
com.backend.utils.DbConfigUtil.getNutDao(DbConfigUtil.java:61)
com.backend.timer.OnlinePlayerJob.execute(OnlinePlayerJob.java:56)
org.quartz.core.JobRunShell.run(JobRunShell.java:202)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
25-Sep-2018 17:44:28.459 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-9] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
25-Sep-2018 17:44:28.459 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [Backend] appears to have started a thread named [DefaultQuartzScheduler_Worker-10] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
下面是我在初始化的时候处理的quartz的corn
public class MainSetup implements Setup {
private static final Logger log = Logger.getLogger(MainSetup.class);
@Override
public void destroy(NutConfig conf) {
ThreadPoolManager.getInstance().destroy();
}
@Override
public void init(NutConfig conf) {
log.info("MainSetup init ----------------------");
Ioc ioc = conf.getIoc();
Dao backendDao = ioc.get(Dao.class, "backendDao");//后台数据库连接
log.info("后台数据库连接 配置读取 backendDao:" + backendDao);
Dao publicServerDao = ioc.get(Dao.class, "daoPublic");//公共数据库
ioc.get(NutQuartzCronJobFactory.class);
Daos.createTablesInPackage(backendDao, "com.backend", false);
这个在入口方法处理的quartzloader
@SetupBy(MainSetup.class)
@Modules(scanPackage=true)
@IocBy(type=ComboIocProvider.class, args={
"*js", "ioc/",
"*anno", "com.backend",
"*tx",
"*org.nutz.integration.quartz.QuartzIocLoader"})
@Fail("jsp:jsp.500")
@Localization(value="language/", defaultLocalizationKey="zh_CN")
@Filters(@By(type = CheckSession.class,args={"USER","/user/tologin"}))
public class MainModule {}