Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-26880

[GSS](8.0.z) WFLY-18536 - LocalUserClient missing from jboss-client.jar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 8.0 Update 3
    • 8.0 Update 1
    • EJB
    • None
    • False
    • None
    • False
      • Add jboss-cli-client.jar to classpath in addition.
      • Or, just use jboss-cli-client.jar instead of jboss-client.jar if jboss-cli-client.jar is sufficient for your usage.
    • Hide

      You can face an authentication issue when executing the following simple JMX client with jboss-client.jar:

      import java.util.*;
      import javax.management.*;
      import javax.management.remote.*;
      
      public class JmxClient {
          public static void main(String[] args) throws Exception {
      
              String host = "127.0.0.1";
              int port = 9990;
              String urlString ="service:jmx:remote+http://" + host + ":" + port;
              JMXServiceURL serviceURL = new JMXServiceURL(urlString);
      
              Map<String, Object> map = new HashMap<>();
              // If you use credentials for remote connection, enable the following two lines.
              // String[] credentials = new String[] { "user", "password" };
              // map.put("jmx.remote.credentials", credentials);
              
              JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, map);
              // System.out.println("JMXConnector =  " + jmxConnector);
      
              MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();
              // System.out.println("MBeanServerConnection = " + connection);
      
              // Invoke on the JBoss AS MBean server
              int count = connection.getMBeanCount();
              System.out.println("MBean Count = " + count);
      
              ObjectName objectName = ObjectName.getInstance("jboss.as:management-root=server");
              String attributeName = "serverState";
              Object result = connection.getAttribute(objectName, attributeName);
              System.out.println("serverState = " + result);
      
              jmxConnector.close();
          }
      }
      

      1. Start JBoss EAP 8.x with the default configuration

      2. Compile and execute the above JMX Client:

      $ javac JmxClient.java
      $ java -cp .:/path/to/jboss-eap-8/bin/client/jboss-client.jar JmxClient
      

      3. You will see the following Exception:

      Exception in thread "main" javax.security.sasl.SaslException: Authentication failed: none of the mechanisms presented by the server (JBOSS-LOCAL-USER, DIGEST-MD5) are supported
      	at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:443)
      	at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:244)
      	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:603)
      	at ...asynchronous invocation...(Unknown Source)
      	at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:600)
      	at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:561)
      	at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:549)
      	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 java.management/javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
      	at JmxClient.main(JmxClient.java:51)
      

      Note:

      • In EAP 7.x, the same JMX client example application can be executed with jboss-client.jar.
      • As jboss-cli-client.jar is sufficient for running the above JMX client example app, you can run the above with jboss-cli-client.jar as a workaround for EAP 8.0.x.
      Show
      You can face an authentication issue when executing the following simple JMX client with jboss-client.jar: import java.util.*; import javax.management.*; import javax.management.remote.*; public class JmxClient { public static void main( String [] args) throws Exception { String host = "127.0.0.1" ; int port = 9990; String urlString = "service:jmx:remote+http: //" + host + ":" + port; JMXServiceURL serviceURL = new JMXServiceURL(urlString); Map< String , Object > map = new HashMap<>(); // If you use credentials for remote connection, enable the following two lines. // String [] credentials = new String [] { "user" , "password" }; // map.put( "jmx.remote.credentials" , credentials); JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, map); // System .out.println( "JMXConnector = " + jmxConnector); MBeanServerConnection connection = jmxConnector.getMBeanServerConnection(); // System .out.println( "MBeanServerConnection = " + connection); // Invoke on the JBoss AS MBean server int count = connection.getMBeanCount(); System .out.println( "MBean Count = " + count); ObjectName objectName = ObjectName.getInstance( "jboss.as:management-root=server" ); String attributeName = "serverState" ; Object result = connection.getAttribute(objectName, attributeName); System .out.println( "serverState = " + result); jmxConnector.close(); } } 1. Start JBoss EAP 8.x with the default configuration 2. Compile and execute the above JMX Client: $ javac JmxClient.java $ java -cp .:/path/to/jboss-eap-8/bin/client/jboss-client.jar JmxClient 3. You will see the following Exception: Exception in thread "main" javax.security.sasl.SaslException: Authentication failed: none of the mechanisms presented by the server (JBOSS-LOCAL-USER, DIGEST-MD5) are supported at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:443) at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:244) 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:603) at ...asynchronous invocation...(Unknown Source) at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:600) at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:561) at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:549) 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 java.management/javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270) at JmxClient.main(JmxClient.java:51) Note: In EAP 7.x, the same JMX client example application can be executed with jboss-client.jar. As jboss-cli-client.jar is sufficient for running the above JMX client example app, you can run the above with jboss-cli-client.jar as a workaround for EAP 8.0.x.

      Backport WFLY-18536 to JBoss EAP 8.0.x branch.

      LocalUserClient is not included in jboss-client.jar due to missing wildfly-elytron-sasl-localuser dependency. This cause requiring credentials at connecting a server from localhost even if local security realm for silent authentication is enabled in the configuration.

            ssur@redhat.com Sudeshna Sur
            rhn-support-mmiura Masafumi Miura
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: