javaamazon-ec2vncjconsole

Jconsole Remote Executable Jar File


I have a remote server that I recently enabled VNC for using vnc4server and Chicken for mac as the client.

The purpose for doing so was to enable running Java's Jconsole to monitor an executable jar file that is running my server logic.

However, after logging into my server using VNC, I keep getting an error when I try to use Jconsole on VNC.

It states connection failed do you want to try again. Now I am logged in as the same user that started the process.

Is there something I am missing when using jconsole in VNC? Also can I monitor my executable jar file remotely using Jconsole on my local machine?

These are the options I am including to run the jar file:

java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9005 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.remote.ssl=false -Djava.rmi.server.hostname=*ipaddress* -jar *path*

Update

These JVM options fixed things. Fix found here: You need to pass to the VM: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false

https://forums.oracle.com/thread/1177644


Solution

  • This does not seem like an VNC issue- either the ports are not open, they are being blocked b a firewall, or there is some kind of permission/authentication issue with the app itself related to monitoring it.

    In order to eliminate VNC as the cause (and use localhost in a local connection on jconsole), do "ssh -X REMOTHOST -n jconsole" and see. This will also eliminate the overhead of running the full X server and VNC.

    Also on linux you can find out what process holds a port open by doing: netstat -ap | grep PORT_NUMBER on the remote host you want to run on.

    Colin