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

Jconsole can't connect to itself

    XMLWordPrintable

Details

    • svc
    • b27

    Backports

      Description

        When you start JConsole, a list is shown of the JVMs you can connect to (obtained from VirtualMachine.list()), but since JDK 9, it is not possible to attach to yourself, so when you try, it fails without any explanation.

        It is possible to override this behavior by specifying -Djdk.attach.allowAttachSelf=true at command line. It would be good if this was added to jconsole launcher, located at:
         
        make/launcher/Launcher-jdk.jconsole.gmk

        Self-attach was blocked to prevent users from programatically breaking the integrity of the runtime by loading an agent into the current VM. This is not an issue for jconsole

        An alternative would be remove the running process from the list you see in start dialog, but it is very convenient to have it for demo purposes, tutorials and exploration of JDK MBeans, so I don't think that is the correct action to take.

        Attachments

          Issue Links

            Activity

              People

                rsunderbabu Ramkumar Sunderbabu
                egahlin Erik Gahlin
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: