The web application [] appears to have started ...
来源:互联网 发布:查看网络攻击的网站 编辑:程序博客网 时间:2024/06/02 19:01
The web application [] appears to have started ...
- 发布时间: 2012/07/25 11:51
- 阅读: 468
- 收藏: 0
- 点赞: 0
- 评论: 0
有看到过这个标题的人吗?我的Tomcat出什么问题了?
有一个servlet,它在init方法里面实例化了一个线程类。这个类里面启动了若干个daemon线程。
有一个listener,它在contextDestroyed方法里面关闭这个线程类。
在catalina.out里面出现了这样的日志。
在下面的这个link里面,apache官方给了一些说明:
http://wiki.apache.org/tomcat/MemoryLeakProtection
其中就包含了这种问题。具体的原因说的很清楚:
Here, when the app is stopped, the webapp classloader is still referenced by the spawned thread both through its context classloader and its current call stack (the anonymous Thread subclass is loaded by the webapp classloader). When stopping an application, tomcat checks the context classloader of every Thread, and if it is the same as the app being stopped, it logs the following message :
当前app的classloader的引用指向到里我的线程类。
修改方法参照官方说明。
leakingThread.setContextClassLoader(null)
还有另外一种修改方法。
在我们的线程类里面加入stop方法:
class Example implements Runnable { private volatile boolean isStop; private Thread runThread; @Override public void run() { runThread = Thread.currentThread(); isStop = false; while(!isStop){ try { process(); } catch (XMPPException e) { log.error("Example logic exception.", e); } } } public void stopRun() { isStop = true; if(runThread != null) { runThread.interrupt(); } }
然后在contextDestroyed方法里面调用stopRun方法。 0 0
- The web application [] appears to have started ...
- 异常:“严重: The web application [] appears to have started a thread named [Thread-”
- 严重: The web application [] appears to have started a thread named [Thread-
- The web application [/jenkins] appears to have started a thread named [Executor [问题点数:20分]
- 严重:The web application [web01] appears to have started a thread named ...
- The web application [] appears to have started a thread named [Thread-
- Tomcat 报错:The web application [XXX] appears to have started a thread...
- 关闭Tomcat报错The web application [ROOT] appears to have started a thread named [Abandoned connectio
- the greeter application appears to be crashing的解决
- tomcat-quartz appears to have started a thread named [startQuertz_Worker-1] but has failed to stop i
- appears to have started a thread named [startQuertz_xxx] but has failed to stop it. This is very...
- 运行IPython中notebook:Kernel Restarting. The kernel appears to have died. It will restart automatically
- (QT4.8.6)QtWebKit笔记---The script on this page appears to have a problem
- the greeter application appears to be crashing. attempting to use a different one...
- Server Error in '/' Application. Access to the Path Is Denied" error message appears
- Server Error in '/' Application. Access to the Path Is Denied" error message appears
- Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in
- It appears as though you do not have permission to view information for any of the hosts you request
- NiceLabel一行多列的条码标签如何打印?
- 轻度隐藏私密文件夹
- 商品加淡灰色的边框(改)
- import static和import的区别
- HTML下使元素在父元素内绝对定位
- The web application [] appears to have started ...
- JavaWeb之Session笔记
- ReactNative安卓首屏白屏优化
- PHP中只发起请求不接受响应,用途:上报
- R语言实战:机器学习与数据分析源代码4
- Docker容器引擎安装和适配器之间的恩怨纠缠
- sqlmap的学习笔记
- Jquery商品飞入购物车动画(全部20行代码)
- Android开发基础复习zhi1