Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jps not showing Tomcat process

Tags:

java

tomcat

I am running Tomcat 6.0.31 on Ubuntu 10.10 and using tge Sun JDK (java-6-sun). Although tomcat is running its process does not show up when I run jps (Java Virtual Machine Process Status Tool). The only output I see is the pid for the jps process itself. Why would the Tomcat process not show up?

like image 307
user768520 Avatar asked Jun 09 '11 03:06

user768520


People also ask

How do I know if Tomcat is running terminal?

A simple way to see if Tomcat is running is to check if there is a service listening on TCP port 8080 with the netstat command. This will, of course, only work if you are running Tomcat on the port you specify (its default port of 8080, for example) and not running any other service on that port.

What is jps command in Java?

The jps command uses the Java launcher to find the class name and arguments passed to the main method. If the target JVM is started with a custom launcher, then the class or JAR file name, and the arguments to the main method aren't available.

What is JPS command in Linux?

The jps command uses the java launcher to find the class name and arguments passed to the main method. If the target JVM is started with a custom launcher, the class name (or JAR file name) and the arguments to the main method will not be available.

How do I know if Tomcat is running on Windows?

Use a browser to check whether Tomcat is running on URL http://localhost:8080 , where 8080 is the Tomcat port specified in conf/server. xml. If Tomcat is running properly and you specified the correct port, the browser displays the Tomcat homepage.


2 Answers

You are probably running into Bug 7009828:

In Java 6 Update 23 and Java 6 Update 24, Java consider the java.io.tmpdir property when deciding where to place some files that were needed for jps, jconsole and jvisulavm to detect locally running JVMs. This means that every JVM instance that had this system property defined to something other than the default (/tmp) would be invisible to these tools.

Tomcat installations in particular default to setting this property to their installations temp folder.

So: either upgrade to Java 6 Update 25 or later (where the bug is fixed) or start jps with -J-Djava.io.tmpdir=/path-to-tomcat-installation/temp.

like image 65
Joachim Sauer Avatar answered Sep 18 '22 11:09

Joachim Sauer


Could it be due to the /tmp/hsperfdata_$USER directories being removed by a cron job running on your system? See http://www.semicomplete.com/blog/geekery/jps-shows-nothing-useful.html for more information.

like image 27
miknight Avatar answered Sep 22 '22 11:09

miknight