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!

  • Is your JVM up and running when you try to connect to JVM? – SMA Jan 05 '15 at 16:42
  • By default, the jmx connector listener binds to the localhost interface. – Nicholas Jan 05 '15 at 18:56
  • 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. –  Jan 05 '15 at 19:27
  • @Nicholas what do you mean? What do I need to change to make it work? –  Jan 05 '15 at 19:27
  • 11
    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 http://stackoverflow.com/questions/151238/has-anyone-ever-got-a-remote-jmx-jconsole-to-work – Klara Jan 09 '15 at 08:41
  • What if the server has dynamic IP? This option should make 0 difference... I'll try it anyway. –  Jan 13 '15 at 11:14

1 Answers1

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 &
hamilton.lima
  • 1,902
  • 18
  • 29