Java learning process -4 Quartz thread can not stop with Tomcat (Exception in thread "DefaultQuartzScheduler_Worker-8" java.lang.NoClassDefFoundError: org / apache / log4j / spi / ThrowableInformation)

 Symptoms: After stopping Tomcat, suggesting Quartz bunch of wrong, a word that can not be stopped, then the process as well as residual tomcat, and then stop it manually, or can not run again

(Exception in thread "DefaultQuartzScheduler_Worker-8" java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation)

From _Worker-1 ~ 10

 

A prompt start to see the log4j thought it was a problem, the version in turn are elevated, or invalid

 

Solution: https:? //Blog.csdn.net/liujun_for_java/article/details/78101478 utm_source = blogxgwz5

1, web.xml in the configuration

 

2, the configuration effective pro-test

 

public class ShutDownQuartz implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {

    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        try {
            Scheduler defaultScheduler = StdSchedulerFactory.getDefaultScheduler();
            defaultScheduler.shutdown(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

=======================

配置前,要手动再停止一次,才能 Disconnected from server

 ================

配置后,干净利落结束了

 

Guess you like

Origin www.cnblogs.com/liuyouying/p/11247434.html