Adam
Adam

Reputation: 1477

JMX is not running on the port specified

I'm trying to enable remote debugging over JMX for a minecraft server but I can't seem to get it working.

I'm using this on the command line to launch it:

java -Dcom.sun.management.jmxremote.port=3000 -jar craftbukkit.jar

Obviously, I haven't setup any authentication or anything but the process seems to launch correctly. I removed all the auth options and nothing has been changed.

However when I run:

lsof | grep 3000 or netstat | grep 3000

Nothing is returned. Any idea why this isn't listening on the port correctly?

Upvotes: 3

Views: 4875

Answers (2)

Sujith
Sujith

Reputation: 1399

Add -Djava.rmi.server.hostname = host ip. Along with

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

Addition of this -Djava.rmi.server.hostname = host ip forces RMI service to use the host ip instead of 127.0.0.1

Upvotes: 2

Chris Nauroth
Chris Nauroth

Reputation: 9844

In addition to the property you've already set, you would need to explicitly disable authentication (com.sun.management.jmxremote.authenticate=false) and disable SSL (com.sun.management.jmxremote.ssl=false). Tying it all together, here is the complete command line:

java -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar craftbukkit.jar

Note that this configuration is considered insecure, because anyone who can guess port 3000 can make a JMX connection to your machine, browse MBean attributes, and run MBean operations. If you're interested in a secure configuration, this document has more details:

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

Upvotes: 1

Related Questions