Tomcat after shutdown.sh, the cause of the process still exists

Source: Internet
Author: User

In the Linux environment, after Tomcat executes the shutdown.sh, the process still exists, which is a headache, and personally think that the most fundamental reason is that there are some non-deamon thread exist, in which case, after Tomcat is closed, the whole process will not end. How do we judge this situation?

You can follow the following steps to determine:

1. Find the PID currently running by Tomcat (using Ps-ef |grep Tomcat),

2. Find the JDK directory, you can use the which Java command, and switch to the bin directory

3. Execute the Jstack PID in the bin directory, check each thread to find the non-Deamon thread, and then determine why the thread does not stop


Example: One of the scenarios I met before was when I was using Quatz's timed task, and because the scheduled task was not set to Deamon, the Tomcat process did not stop. Later configuration of the Quatz thread for Deamon thread to solve the problem. Here are the relevant configurations,

<property name= "Quartzproperties" >

<props>

<prop key= "Org.quartz.scheduler.makeSchedulerThreadDaemon" >true</prop>

<prop key= "Org.quartz.threadPool.makeThreadsDaemons" >true</prop>

</props>

</property>

The above configuration is placed in the Bean configuration item class= "Org.springframework.scheduling.quartz.SchedulerFactoryBean".



This article is from the "Knowledge Porter" blog, please be sure to keep this source http://xiaoge90s.blog.51cto.com/6920186/1642209

Tomcat after shutdown.sh, the reason why the process still exists

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.