Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-10890

CLI client in jconsole doesn't work with JDK11

    Details

      Description

      CLI client in jconsole doesn't work with JDK11.

      JConsole uses CLI. CLI uses WildFlySecurityManager (Elytron 1.5.4.Final). WildFlySecurityManager uses sun.misc.Unsafe. Unsafe works just with adding of --add-modules=jdk.unsupported to JConsole:

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      --- a/jconsole.sh
      +++ b/jconsole.sh
      @@ -79,4 +79,4 @@ CLASSPATH=$CLASSPATH:./bin/client/jboss-cli-client.jar
       echo CLASSPATH $CLASSPATH
       
       cd "$JBOSS_HOME"
      -$JAVA_HOME/bin/jconsole -J-Djava.class.path="$CLASSPATH" "$@"
      +$JAVA_HOME/bin/jconsole -J--add-modules=jdk.unsupported -J-Djava.class.path="$CLASSPATH" "$@"
      \ No newline at end of file
      

      But "jdk.unsupported" module is not a correct fix.

      Logs:

      Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: sun/misc/Unsafe
      	at org.wildfly.security.manager.WildFlySecurityManager.<clinit>(WildFlySecurityManager.java:122)
      	at org.jboss.as.cli.CommandContextFactory.getInstance(CommandContextFactory.java:41)
      	at org.jboss.as.cli.gui.ConnectDialog$2.actionPerformed(ConnectDialog.java:182)
      	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
      	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
      	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
      	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
      	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
      	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
      	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6631)
      	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
      	at java.desktop/java.awt.Component.processEvent(Component.java:6396)
      	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
      	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
      	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
      	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
      	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
      	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
      	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
      	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
      	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
      	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
      	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
      	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
      	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
      	at java.base/java.security.AccessController.doPrivileged(Native Method)
      	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
      	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
      	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
      	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
      	at java.base/java.security.AccessController.doPrivileged(Native Method)
      	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
      	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
      	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
      	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
      	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
      	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
      	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
      	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
      Caused by: java.lang.ClassNotFoundException: sun.misc.Unsafe
      	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
      	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      	... 39 more
      

      cc: Kabir Khan, James Perkins, Darran Lofthouse, Martin Choma, Martin Svehla, Ondrej Kotek, Rostislav Svoboda

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jdenise Jean Francois Denise
                  Reporter:
                  mkopecky Marek Kopecky
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: