2 Replies Latest reply on Aug 28, 2012 5:26 PM by Jay SenSharma

    java.net.ConnectException: JBAS012144: Could not connect to remote:

    thinksteep thinksteep Novice

      Hi Community,

       

      I am trying to use JBoss native management API to get datasource related details through a standalone client (Our Jboss is in standalone mode). This client is working only for localhost as hostname.

       

      It is failing for IP (or) computer name. Below is the exception stack:  Any help would be appreciated.

       

      INFO: JBoss Remoting version 3.2.3.GA

      java.io.IOException: java.net.ConnectException: JBAS012144: Could not connect to remote://myhostName:9999. The connection timed out

          at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:139)

          at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:81)

          at com.mypackage.mytest.JBoss7Instrumentation.main(JBoss7Instrumentation.java:36)

      Caused by: java.net.ConnectException: JBAS012144: Could not connect to remote://myhostName:9999. The connection timed out

          at org.jboss.as.protocol.ProtocolChannelClient.connectSync(ProtocolChannelClient.java:155)

          at org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy$Establishing.getChannel(ManagementClientChannelStrategy.java:166)

          at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:137)

          at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:62)

          at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:106)

          at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:89)

          at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:252)

          at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:151)

          at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:137)

          ... 2 more

       

      And here is part of standalone client:

       

                  ModelControllerClient client = ModelControllerClient.Factory.create(InetAddress.getByName("myhostName"), 9999);

                  ModelNode op = new ModelNode();

                  op.get("operation").set("read-children-resources");

                  op.get("include-runtime").set(true);

                  op.get("recursive").set(true);

                  op.get("child-type").set("subsystem");

       

      Here is standalone configuration part:

       

      <management-interfaces>

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

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

                  </native-interface>

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

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

                  </http-interface>

              </management-interfaces>

          </management>

       

      ............

       

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

       

      Thank you for your time and help.