3 Replies Latest reply on Sep 16, 2017 5:54 AM by Tomaz Cerar

    Issues with Native Client

    Bob Larsen Newbie

      I am attempting to read a portion of the Wildfly config from within a deployed application.  I'm following the documentation found here:


      Wildfly will not start with the line (from the documentation):

      <native-interface interface="management" port="9999" security-realm="ManagementRealm"/>

      in <management><managemeent-interfaces> as the "interface" and "port" attributes aren't recognized.  I've replaced that with:

      <native-interface security-realm="ManagementRealm">

          <socket-binding native="management-native"/>


      and added

      <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

      to <socket-binding-group>.


      Wildfly seems happy with this configuration, and starts without error, and is listening on port 9999.


      However the client is not able to connect:

      java.net.ConnectException: JBAS012144: Could not connect to remote://hostname.local:9999. The connection timed out


      The code being executed is based on the code in the documentation:


              final CallbackHandler handler = (Callback[] callbacks) -> {

                  for (Callback cb : callbacks) {

                      if (cb instanceof NameCallback) {

                          NameCallback ncb = (NameCallback) cb;


                      } else if (cb instanceof PasswordCallback) {

                          PasswordCallback pwcb = (PasswordCallback) cb;


                      } else if (cb instanceof RealmCallback) {

                          RealmCallback rcb = (RealmCallback) cb;


                      } else {

                          throw new UnsupportedCallbackException(cb);




              try (ModelControllerClient client = ModelControllerClient.Factory.create(InetAddress.getLocalHost(), 9999, handler)) {

                  final ModelNode op = new ModelNode();


                  ModelNode address = op.get("address");

                  address.set("subsystem", "keycloak");


                  final ModelNode result = client.execute(op);

                  if (Operations.isSuccessfulOutcome(result)) {


                  } else {

                      throw new RuntimeException(Operations.getFailureDescription(result).asString());




      The relevant portion of the pom is:







      I'm not sure if this is an issue with the config or with the code, since I cannot get a connection at all.  Any help would be greatly appreciated.