I am trying to use JConsole on my local windows machine. The web application is running locally on port 80. When I tried to use Jconsole, it does not give me the PIDs ( I am not sure how to find PIDs in windows) to choose from. I can see the monitoring by using remote TAB (host or IP as localhost and port as 0). But that is not real analysis for the web application I want to monitor. Could someone please help me with this set up.
The pid is the process id for the Java app. JConsole should pick up all Java apps running. However, you do have to start the Java apps using the "-Dcom.sun.management.jmxremote" option. [ November 14, 2008: Message edited by: Peter Johnson ]
What mechanism are you using to start the Java application? (Web site URL please!) Obviously you are not running it from a command line. Also, is your application running as a process named "java" or is it using a different name? JConsole probably looks only for processes named "java".
Also, try using listdlls or Process Manager, both from [url=http://technet.microsoft.com/en-us/sysinternals/default.aspx]sysinternals/url], to view the command line of the running Java application and ensure that the option is set.
Also, what version of JDK? And what version of Windows? And what app are you running?
JConsole uses the attach API and it is only available for JVMs running with JDK 1.5+. If the process is running as a windows service the local attach API might not be able to connect since the process could have been started by another user. The easiest way to fix this is probably to connect using a network port.
and add the remote process in JConsole as: localhost:<portNumber>. Or you could use the JRockit JVM and JRockit Mission Control, instead of JConsole. JRMC can discover JVMs on the network if you specify autodiscovery flag at startup.
and you you'll see the JVM pop up in the browser to the left automatically, right click and choose Start Console. It even works for JDK 1.4, but then you'll have to remove authentication and ssl from the command line.
Joined: Nov 07, 2008
The application is started as
http://ws011.app.com/test and I think the application is running as webservd application. I downloaded the process Explorer and It states the PIDs.
I tried your mechanism, but my webserver is running on port 80. Should I use the same port number as it states that the port is already in use.
That is not how an application is started - that is how an application is accessed.
Apparently your application is running in some kind of web or application server (Tomcat? JBossAS? WebspereAS? WLS?), how is that web/application server started?
Also, is ws011.app.com the name of your PC? JConsole will only show process ids for Java apps running on your PC. If ws011.app.com is remote, you will have to use the remote access mechanisms to access the web/app server
Joined: Nov 07, 2008
The application is started using the servstart.bat file and is running on IPlanet6.1SP8 server. and yes, ws011.app.com is the name of my PC.
How does the servstart.bat file run IPlanet? Does it use java.exe or does IPlanet have its own executable?
If it uses java.exe, did you modify servstart.bat file to include the -Dcom.sun.management.jmxremote?
If it uses its own executable (which I think is the case because of your earlier post on how you set com.sun.management.jmxremote), you will have to set IPlanet to use remote jmx connections. To do this, set these system properties:
-Dcom.sun.management.jmxremote.port=9999 (set it to any available port number) -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
After you restart IPLanet, you should be able to connect JConsole by specifying the host name and port number on the Remote tab of the Connect to Agent dialog (I assume you are using JDK 1.5, I asked but you never said).