Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jconsole cannot connect to java processes running as Windows 7 Services

We have a Java process which we run as a Windows service (using srvany). It runs with Java 1.6 (1.6.0.23 at the moment).

In the past (Windows XP), I could connect JConsole to the processes, on Windows 7 I cannot do this anymore.

If I run jconsole <pid> I get “Invalid process id:4488”. The services are running as SYSTEM user.

If I make the service run as my desktop user (using “Log On as This Account”) the services process ID appear in JConsole, but they are grayed out and I cannot connect.

Is it impossible to dynamically connect to Java processes when they are running as a Windows 7 service?

like image 757
Neil Wightman Avatar asked Jan 12 '11 13:01

Neil Wightman


People also ask

How does JConsole connect to Tomcat as a service?

Connect to the Tomcat service using remote JMX connection. Navigate to the apache-tomcat\bin directory. Rename tomcate6w.exe to jasperserverTomcat.exe, double-click on it to open the Tomcat properties window. In the Java tab add the following properties to the end of the Java Options window and restart the service.

How do I run JConsole on Windows?

Starting JConsole. The jconsole executable can be found in JDK_HOME/bin, where JDK_HOME is the directory in which the Java Development Kit (JDK) is installed. If this directory is in your system path, you can start JConsole by simply typing jconsole in a command (shell) prompt.

Does JConsole include JRE?

The Java Server JRE as of release 8u45 ships with jconsole under /lib.


1 Answers

Perhaps it is a 64bit/32bit problem, I have several applications compiled with 32bit JDK, which could not be opened with JConsole from 64bit JDK on Windows 7 64bit, after I downloaded the 32bit JDK it worked.

like image 149
xu huanze Avatar answered Oct 17 '22 22:10

xu huanze