spring+quartz关闭tomcat时sw_QuartzSchedulerThread无法关闭问题

一只白白的程序猿 2017-12-11 04:59:28
报错部分如下:这是在idea关闭Tomcat的报错。如果是在Linux上shutdown的话,无法关闭Tomcat线程,需要kill掉。有知道的大神请指点一下。谢谢
2017-12-11 16:45:45,426 INFO [localhost-startStop-1] support.AbstractApplicationContext (AbstractApplicationContext.java:960) - Closing WebApplicationContext for namespace 'mvc-dispatcher-servlet': startup date [Mon Dec 11 16:35:33 CST 2017]; parent: Root WebApplicationContext
2017-12-11 16:45:45,439 INFO [localhost-startStop-1] support.AbstractApplicationContext (AbstractApplicationContext.java:960) - Closing Root WebApplicationContext: startup date [Mon Dec 11 16:35:23 CST 2017]; root of context hierarchy
2017-12-11 16:45:45,445 WARN [localhost-startStop-1] support.DisposableBeanAdapter (DisposableBeanAdapter.java:364) - Invocation of destroy method 'close' failed on bean with name 'batchSqlSession': java.lang.UnsupportedOperationException: Manual close is not allowed over a Spring managed SqlSession
2017-12-11 16:45:45,446 WARN [localhost-startStop-1] support.DisposableBeanAdapter (DisposableBeanAdapter.java:364) - Invocation of destroy method 'close' failed on bean with name 'sqlSession': java.lang.UnsupportedOperationException: Manual close is not allowed over a Spring managed SqlSession
2017-12-11 16:45:45,454 INFO [localhost-startStop-1] pool.DruidDataSource (DruidDataSource.java:1385) - {dataSource-1} closed
11-Dec-2017 16:45:45.468 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [sw] 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.
11-Dec-2017 16:45:45.468 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [sw] 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.
11-Dec-2017 16:45:45.469 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [sw] appears to have started a thread named [sw_QuartzSchedulerThread] 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.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:410)
11-Dec-2017 16:45:45.474 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
11-Dec-2017 16:45:45.476 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
11-Dec-2017 16:45:45.477 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
11-Dec-2017 16:45:45.478 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.DataSourceClosedException: dataSource already closed at Mon Dec 11 16:45:45 CST 2017
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:390)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:439)
at schedule.quartz.WeiboFansJob.execute(WeiboFansJob.java:43)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: com.alibaba.druid.pool.DataSourceClosedException: dataSource already closed at Mon Dec 11 16:45:45 CST 2017
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1057)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:960)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4544)
at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:662)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4540)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:938)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:930)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:102)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
... 5 more
...全文
566 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧