wood burning stoves 2.0*
The moose likes Performance and the fly likes help with jconsole Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "help with jconsole" Watch "help with jconsole" New topic
Author

help with jconsole

Jyoti karva
Greenhorn

Joined: Nov 07, 2008
Posts: 5
Hello All,

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.

Thanks.
Jyothy
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

JYothy, welcome to Java Ranch!

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 ]

JBoss In Action
Jyoti karva
Greenhorn

Joined: Nov 07, 2008
Posts: 5
I added this "-Dcom.sun.management.jmxremote" to the JVM Options in the server.xml. But still I am not able to see the my application in jconsole. I added this as

<JVMOPTIONS>-Dcom.sun.management.jmxremote</JVMOPTIONS>

Any other parameter I need to add? I dont know as this is not a remote application. This is local application running on the same machine as the jconsole.

Thanks.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

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?
Per Halvarsson
Greenhorn

Joined: Aug 14, 2008
Posts: 6
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.

>java -Dcom.sun.management.jmxremote.port=<portNumber> -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
=false ...

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.

>java -Xmanegement:ssl=false,authenticate=false,port=<portNumber>,autodiscovery=true ...
>jrmc

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.
Jyoti karva
Greenhorn

Joined: Nov 07, 2008
Posts: 5
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.

Per,

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.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

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
Jyoti karva
Greenhorn

Joined: Nov 07, 2008
Posts: 5
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.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help with jconsole
 
Similar Threads
What is the meaning of data displayed by netstat -a
JMX with Tomcat
Monitor application in Linux using Jconsole
sql query
using jconsole