Wednesday, December 15, 2010

Remote monitoring of a Java application with JConsole

see http://download.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote

and better still here http://www.performanceengineer.com/blog/monitoring-weblogic-using-jmx/

set these properties:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8888
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false



CAVEAT: on the same machine you could have multiple WLS.
You cannot assign the same jmx port to all of them.
You should prepare an individual script for each managed server,

where you set
export JAVA_OPTIONS="-Dcom.sun.management.jmxremote.port=8888"

and of course use a different port for each WLS.

Something like this:

startOSB.sh:

export JAVA_OPTIONS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8888 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
nohup ./startManagedWebLogic.sh osb_server1 http://myserver:7001 2>&1 > . ../servers/osb_server1/logs/osb_server1.out &



startSOA.sh:

export JAVA_OPTIONS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8889 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

nohup ./startManagedWebLogic.sh soa_server1 http://myserver:7001 2>&1 > ../servers/soa_server1/logs/soa_server1.out &


You will need to enable these settings when you want to connect VisualVM with JMX, see here http://visualvm.java.net/jmx_connections.html

1 comment:

Anonymous said...

Nice article ,Remote Debugging was the single most feature which is very useful while developing larget enterprise application, specially
if your applicaiton is live and you don't have proper development environment setup in your dev box.

Thanks
Javin
How to setup remote debugging in Eclipse