Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8275176

JConsole cannot connect to JVM running inside a container

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 17
    • tools

      After starting a JVM process inside a docker container, I can access it using jcmd from the host, as long as I run as root:

      $ sudo jcmd $PID .....

      However, I cannot connect to the JVM process with JConsole, even if I run it as root:

      $ sudo jconsole $PID

      The JVM process's console (inside the container) prints:

      Oct 13, 2021 12:07:01 AM sun.rmi.transport.tcp.TCPTransport$AcceptLoop run
      WARNING: RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,localport=35857] throws
      java.io.IOException: The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported.
      at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114)
      at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:413)
      at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:377)
      at java.base/java.lang.Thread.run(Thread.java:833)

            lcable Larry Cable
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: