0 Replies Latest reply on Nov 25, 2018 3:53 AM by jim_b_o

    Connect to WildFly with JMC 7

    jim_b_o

      WildFly/JBoss requires a custom JMX config which in turn requires the jboss-cli-client.jar on the classpath.  This can be achieved by adding a line such as the one below to the jmc.ini file after the -vmargs:

       

      -Xbootclasspath/a:/some-path/jboss-cli-client.jar

       

      This works OK with JMC 6 but with JMC 7 the following error occurs when attempting the connection:

       

      org.openjdk.jmc.rjmx.ConnectionException caused by javax.security.sasl.SaslException: org/ietf/jgss/GSSManager [Caused by java.lang.NoClassDefFoundError: org/ietf/jgss/GSSManager]  
        at org.openjdk.jmc.rjmx.internal.RJMXConnection.connect(RJMXConnection.java:442)  
        at org.openjdk.jmc.rjmx.internal.ServerHandle.doConnect(ServerHandle.java:116)  
        at org.openjdk.jmc.rjmx.internal.ServerHandle.connect(ServerHandle.java:106)  
        at org.openjdk.jmc.console.ui.editor.internal.ConsoleEditor$ConnectJob.run(ConsoleEditor.java:99)  
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)  
      Caused by: javax.security.sasl.SaslException: org/ietf/jgss/GSSManager [Caused by java.lang.NoClassDefFoundError: org/ietf/jgss/GSSManager]  
        at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:426)  
        at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:242)  
        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)  
        at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)  
        at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)  
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)  
        at ...asynchronous invocation...(Unknown Source)  
        at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:571)  
        at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:533)  
        at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:521)  
        at org.jboss.remotingjmx.RemotingConnector.internalRemotingConnect(RemotingConnector.java:268)  
        at org.jboss.remotingjmx.RemotingConnector.internalConnect(RemotingConnector.java:156)  
        at org.jboss.remotingjmx.RemotingConnector.connect(RemotingConnector.java:103)  
        at org.openjdk.jmc.rjmx.internal.RJMXConnection.connectJmxConnector(RJMXConnection.java:488)  
        at org.openjdk.jmc.rjmx.internal.RJMXConnection.establishConnection(RJMXConnection.java:465)  
        at org.openjdk.jmc.rjmx.internal.RJMXConnection.connect(RJMXConnection.java:435)  
        ... 4 more  
      Caused by: java.lang.NoClassDefFoundError: org/ietf/jgss/GSSManager  
        at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)  
        at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3138)  
        at java.base/java.lang.Class.getConstructor0(Class.java:3343)  
        at java.base/java.lang.Class.getConstructor(Class.java:2152)  
        at java.base/java.security.Provider.newInstanceUtil(Provider.java:152)  
        at java.base/java.security.Provider$Service.newInstance(Provider.java:1824)  
        at org.wildfly.security.sasl.util.SecurityProviderSaslClientFactory.createSaslClient(SecurityProviderSaslClientFactory.java:94)  
        at org.wildfly.security.sasl.util.AbstractDelegatingSaslClientFactory.createSaslClient(AbstractDelegatingSaslClientFactory.java:66)  
        at org.wildfly.security.sasl.util.ProtocolSaslClientFactory.createSaslClient(ProtocolSaslClientFactory.java:50)  
        at org.wildfly.security.sasl.util.AbstractDelegatingSaslClientFactory.createSaslClient(AbstractDelegatingSaslClientFactory.java:66)  
        at org.wildfly.security.sasl.util.ServerNameSaslClientFactory.createSaslClient(ServerNameSaslClientFactory.java:50)  
        at org.wildfly.security.sasl.util.AbstractDelegatingSaslClientFactory.createSaslClient(AbstractDelegatingSaslClientFactory.java:66)  
        at org.wildfly.security.sasl.util.ServerNameSaslClientFactory.createSaslClient(ServerNameSaslClientFactory.java:50)  
        at org.wildfly.security.sasl.util.FilterMechanismSaslClientFactory.createSaslClient(FilterMechanismSaslClientFactory.java:102)  
        at org.wildfly.security.sasl.util.AbstractDelegatingSaslClientFactory.createSaslClient(AbstractDelegatingSaslClientFactory.java:66)  
        at org.wildfly.security.sasl.util.LocalPrincipalSaslClientFactory.createSaslClient(LocalPrincipalSaslClientFactory.java:76)  
        at org.wildfly.security.sasl.util.PrivilegedSaslClientFactory.lambda$createSaslClient$0(PrivilegedSaslClientFactory.java:64)  
        at java.base/java.security.AccessController.doPrivileged(Native Method)  
        at org.wildfly.security.sasl.util.PrivilegedSaslClientFactory.createSaslClient(PrivilegedSaslClientFactory.java:64)  
        at org.wildfly.security.auth.client.AuthenticationConfiguration.createSaslClient(AuthenticationConfiguration.java:1363)  
        at org.wildfly.security.auth.client.AuthenticationContextConfigurationClient.createSaslClient(AuthenticationContextConfigurationClient.java:409)  
        at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:420)  
        at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:242)  
        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)  
        at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)  
        at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)  
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)  
      

       

      I've tried setting JMC 7 to use a full copy of the JDK instead of the trimmed bundled one and to explicitly include the module that contains org/ietf/jgss/GSSManager (transitively from java.security.jgss) with config such as the following:

       

      -vm

      /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin

      -vmargs

      -Xbootclasspath/a:/some-path/jboss-cli-client.jar

      --add-modules=jdk.security.jgss

       

      I've also tried a few other crazy things but with no luck.  I can't seem to get the required class onto the classpath.

      Unfortunately the Eclipse/OSGI environment seems to be preventing me from getting the java classpath diagnostic logging to show up anywhere.

       

      Is it possible I'm still missing something in the JDK 11 modules config?  I've tried a few other things such as --add-exports=jdk.security.jgss/org.ietf.jgss=ALL-UNNAMED.

      Or is there an OSGI thing getting in the way?

       

      Any help appreciated.  I'm a big JMC fan and don't want to go back to JConsole.