Cannot connect to JMX/RMI server with VisualVM for no apparent reason
Asked Answered
B

1

13

I have my OSGi application launching with the following command in my remote machine:

java -Dcom.sun.management.jmxremote \
  -Dcom.sun.management.jmxremote.port=8080 \
  -Dcom.sun.management.jmxremote.local.only=false \
  -Dcom.sun.management.jmxremote.authenticate=false \
  -Dcom.sun.management.jmxremote.ssl=false \
  -jar bin/felix.jar

And in my local machine I have VisualVM from which I try to connect to the remote JVM instance:

enter image description here

enter image description here

enter image description here

What am I missing?

Thanks!

Barite answered 5/1, 2015 at 16:37 Comment(6)
Is your JVM up and running when you try to connect to JVM?Argot
By default, the jmx connector listener binds to the localhost interface.Kurtzig
I launch java with the command I posted above, then I try to connect using VisualVM as you can see. If I launch java in the same machine I have VisualVM it detects the JVM instance instantly, so I can't understand why it fails remotely, though locally I don't need to put those -Dcom flags.Barite
@Kurtzig what do you mean? What do I need to change to make it work?Barite
Try adding -Djava.rmi.server.hostname=sb-prd.tagus.ist.utl.pt (or whatever the hostname of your remote server is). For more info see for instance #151738Dissepiment
What if the server has dynamic IP? This option should make 0 difference... I'll try it anyway.Barite
H
7

The comment from @Klara saved my day !! fixed my connection to the jstad

jstatd -J-Djava.security.policy=all.policy -J-Djava.rmi.server.hostname=hostname-goes-here &
Heigl answered 10/2, 2016 at 18:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.