Starting a java process with remote control

I am trying to start a java process and enable remote connections using jconsole. I add the following parameters to the command line (in front of the main class):

-Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote. authenticate=false 

using netstat, I see jvm listening on port 9999:

 tcp6 0 0 :::9999 :::* LISTEN 16971/java 

however, when I try to connect to jconsole localhost: 9999, I get an error message indicating that the connection failed.

any idea?

+4
source share
2 answers

There is a space between "... jmxremote". and "authenticate" in what you entered above. If this is copy / paste, perhaps make sure that it is not on your command line.

In addition, you can simplify by disabling SSL: -Dcom.sun.management.jmxremote.ssl = false

+6
source

Are you sure you are using IPv6? Otherwise, you should prefer IPv4 for your service.

-Djava.net.preferIPv4Stack = true

+4
source

All Articles