我是servlets和使用Tomcat 7.0.34版本的新手(我们被指示仅使用此版本)。我的问题是,Tomcat似乎在某个时间点重新启动,这发生在我一段时间不与servlet交互时。我看到以下内容:运行Servlet时的RuntimeException:Tomcat自己重新启动
此外,当我通过月食试图调试我看到在调试窗口中输入以下内容:
Daemon Thread [http-bio-80-exec-1] (Suspended (exception RuntimeException))
ThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: not available
ThreadPoolExecutor$Worker.run() line: not available
TaskThread(Thread).run() line: not available
而这个控制台:
SEVERE: The web application [/csj] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.
Okt 03, 2016 1:39:39 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/csj] is completed
我想知道为什么Tomcat是重新启动。如果我不停地点击按钮,那么就不会看到这个问题。
我试着在这里看:Tomcat showing this error "This is very likely to create a memory leak". How to resolve this issue?和在这里:The web application [ROOT] is still processing a request that has yet to finish. [Tomcat]但我很难理解。
看来这个问题已经解决了在更新版本的Tomcat根据这个:http://wiki.apache.org/tomcat/MemoryLeakProtection。不过,我想了解这个问题是什么。
编辑:使用Eclipse-MARS
不幸的是,这并没有解决问题...我在控制台中看到以下内容:Okt 03,2016 8:17:13 PM org.apache.catalina.core.StandardContext reload INFO:Reloading Context with name [/BestDeal]已开始 2016年3月3日8:17:14 org.apache.catalina.core.StandardContext重新加载 信息:名称[/ BestDeal]的重新加载上下文已完成 – hrushi
在\ tomcat \ conf \ server.xml中,在
一个问题:在Servlet中使用getClass()是否会造成潜在的内存泄漏? – hrushi