In some more complex scenarios these VM Options may help:
-Djava.rmi.server.hostname=localhost
-Dcom.sun.management.jmxremote.port=6799
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
Any other free port can be used instead of 6799.