JPS unable to get to the Tomcat (Java) process

Source: Internet
Author: User

First, the problem description:

Ubuntu 10.10 version, the same JDK version 1.6, after booting Tomcat, using JPS cannot get the native Java process.

Second, JPS working principle:

1. When the Java process starts, if the-djava.io.tmpdir parameter is not specified, the new/tmp/hsperfdata_${user_name} file is created by default

2. JPS to scan the/tmp/hsperfdata_${user_name} file while querying the Java process

Third, the JPS can not work properly, may exist the reason:

1. Launch Tomcat with different versions of Java and JPS

2. JPS cannot read/tmp/hsperfdata_${user_name} file because of permissions issues

3. The Java process starts with the-djava.io.tmpdir parameter specified, that is, the default value is not used

Four, the problem positioning:

1. PS Query Java startup parameters

[Python]View Plaincopy
    1. Ps-ef | grep java | grep "Djava.io.tmpdir"
Discover that Tomcat does have a specified Djava.io.tmpdir parameter

2. Modify the Tomcat default catalina.sh file and modify the following

[Python]View Plaincopy
    1. If [-Z ' $CATALINA _tmpdir]; Then
    2. # Define The Java.io.tmpdir to use for Catalina
    3. Catalina_tmpdir=/tmp
    4. Fi

3. Restart Tomcat, re-execute JPS, problem resolution

JPS unable to get to the Tomcat (Java) process

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.