0

I'm not able to connect JVisualVM to Glassfish running on Docker. I'm using the glassfish nightly image and I'm exposing port 8686. On Startup Glassfish is logging the following:

JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://55bbdd404578:8686/jndi/rmi://55bbdd404578:8686/jmxrmi

The IP of my docker host is 192.168.99.100 and I can connect via telnet on port 8686.

The Service URL I'm using is service:jmx:rmi://192.168.99.100:8686/jndi/rmi://192.168.99.100:8686/jmxrmi and I'm passing the security credentials but can't connect. Am I missing something?

lefloh
  • 10,653
  • 3
  • 28
  • 50

2 Answers2

2

Struggled with the same issue.

Add following to server-config –> jvm-settings –> JVM option

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port='your JMX port'
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname='IP of you docker host'

and simply do the rest in the same way as before.

When U look at server.log U'll notice that JMX service is exposed as:

JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://e15295161718:40086/jndi/rmi://e15295161718:40086/jmxrmi

and problably these configuration entries change e15295161718 to IP and JVisualVM can connect. From Ur host's perspective e15295161718 is rubbish to JVisualVM.

maciek
  • 83
  • 7
0

Port 8686 is not exposed by Docker file, therefore You need to use --publish 8686:8686 with docker run command to make that port exposed to the host computer. See docker help run for mire details.

hlihovac
  • 368
  • 2
  • 10
  • Thanks for your answer but as I wrote in the question: I am exposing port 8686 and I can connect via telnet so I'm pretty sure the port is open. – lefloh Sep 01 '15 at 14:10