作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我使用 Quartz 2.x 运行 Web 应用程序时,我收到此消息。它运行良好,但我在声明服务器时收到此错误
INFO: Server startup in 1792 ms
20 mai 2014 18:18:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/servlet] appears to have started a thread named [Thread-4] but has failed to stop it. This is very likely to create a memory leak.
20 mai 2014 18:18:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/servlet] appears to have started a thread named [CronTriggers_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
20 mai 2014 18:18:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/servlet] appears to have started a thread named [CronTriggers_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
感谢任何帮助。
最佳答案
这可能是由于 Tomcat 关闭或 Web 应用程序重新部署时未关闭 Quartz 调度程序(很可能是您的情况)造成的。
您需要实现 ServletContextListener 并在其 contextDestroyed 方法中执行以下操作:
scheduler.shutdown( true ); // true = wait for jobs to complete
// you may want to give Quartz some extra time to shutdown
//Thread.sleep(1000);
您可能还需要配置 Quartz 线程池以将其线程标记为“守护线程”(org.quartz.threadPool.makeThreadsDaemons=true),因为它们不会阻止 JVM 停止。否则,JVM 将等待所有这些工作线程完成。
关于java - quartz 2.x : GRAVE: The web application [/servlet] appears to have started a thread named [Thread-4] but has failed to stop it,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23765286/
我是一名优秀的程序员,十分优秀!