简体   繁体   中英

Running a java process with remote management enabled

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

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

using netstat, I see that the jvm is listening on port 9999:

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

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

any idea?

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

Also, you could simplify by disabling SSL: -Dcom.sun.management.jmxremote.ssl=false

Are you sure, that you're using IPv6? Otherwise, you should prefer IPv4 for your service.

-Djava.net.preferIPv4Stack=true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM