Jconsole (Java)

jconsole is a gui tool that ships with the jdk.

since 1.6 it supports using a socks proxy to connect to a remote system.

jconsole can be used to monitor local and remote applciations.

(oracle recomment remote monitoring with jconsole, to limit the resource contention)

Dynamic attachment
"'However, the version of JConsole provided with the Java SE 6 platform can attach to any application that supports the Attach API. In other words, any application that is started in the Java SE 6 HotSpot VM is detected automatically by JConsole, and does not need to be started using the above command-line option.'"

So basically, if you don't have remote debugging enabled applications can be attached to locally using jconsole (and X forwarding, or something hacky like that)

Debugging jconsole
So its not working. Well turn on the logging and the debugging like this then

jconsole -debug -J"-Djava.util.logging.config.file=FILENAME"

SSL
glassfish and similar will enable SSL on JMX remote ports, so you can either configure it using the details below, or disable it like so;

http://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html#SSL_disabled

com.sun.management.jmxremote.ssl=false

if your jmx is protected by a firewall and tunnelled over SSH, you might want to disable authentication also;

com.sun.management.jmxremote.authenticate=false com.sun.management.jmxremote.ssl=false

Assuming you created a keystore as described in the JSSE Guide and started your application (Server) as follows:

% java -Djavax.net.ssl.keyStore=keystore \ -Djavax.net.ssl.keyStorePassword=password Server

To connect to this application, you need to run jconsole as follows:

% jconsole -J-Djavax.net.ssl.trustStore=truststore \ -J-Djavax.net.ssl.trustStorePassword=trustword

Using jconsole - chapter 3 "Java SE Monitoring and Management guide" http://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html

troubleshooting
http://blog.cantremember.com/debugging-with-jconsole-jmx-ssh-tunnels/

tomcat 5
on tomcat 5.5x you can configure a remote JMX port using the standard JVM options like so in startup.sh, or whereever is appropriate; set CATALINA_OPTS=-Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=%my.jmx.port% \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false

Tomcat 6
http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html

tomcat provides some ant tasks to allow ant to work with JMX management extensions here; http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html#Manage_Tomcat_with_JMX_remote_Ant_Tasks

glassfish
glassfish provides a JSR 160 compliant JMX connector on port 8686 by default

this is enabled from the "server-config"->Admin Service menu

other
Note: If the JMX agent is using in a connector which is not included in the Java platform, you need to add the connector classes to the classpath when running jconsole as follow:

jconsole -J-Djava.class.path=JAVA_HOME/lib/jconsole.jar:JAVA_HOME/lib/tools.jar:connector-path