2 Replies Latest reply on Jan 23, 2013 4:01 AM by formica

    Cannot connect to remote host using jboss-cli.sh via SOCKS in JBoss 7.1.1.Final

    formica

      I tried to connect to a remote instance of JBoss AS 7.1.1 (Brontes) which is behind a firewall using jboss-cli.sh command line,

      and I did not manage; the cli script launched with

      JAVA_OPTS="-DsocksProxyHost=localhost -DsocksProxyPort=3129"

      ./bin/jboss-cli.sh --connect --controller=<myremote.host>

      fails with

       

      org.jboss.as.cli.CliInitializationException: Failed to connect to the controller

                at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:229)

                at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:207)

                at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.modules.Module.run(Module.java:260)

                at org.jboss.modules.Main.main(Main.java:291)

      Caused by: org.jboss.as.cli.CommandLineException: The controller is not available at pcsaclay32c.cern.ch:9999

                at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:639)

                at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:613)

                at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:227)

       

       

      I use standalone configuration, containing in standalone.xml the default

       

      {code:xml}

      .....

              <subsystem xmlns="urn:jboss:domain:jmx:1.1">

                  <show-model value="true"/>

                  <remoting-connector/>

              </subsystem>

      .....

      {code}

      I have a user in the standalone/configuration/mgmt-users.properties file which has been added using the add-user commands.

      As far as I understood, remoting will use the ManagemenRealm.

       

      The connection to the Web admin console using Firefox and Safari works from remote (once I have the socks proxy defined), and the

      connection within the remote host (running jboss-cli from the remote host I mean) works also.

       

      Can you suggest me where to look to solve my problem ?

      Thanks,

      Andrea

       

       

      PS: I'm using Java version 6

        • 1. Re: Cannot connect to remote host using jboss-cli.sh in JBoss 7.1.1.Final
          formica

          I just realized I did a wrong cut and paste (I was testing a problem with the jconsole as well at the same time...)

          What I wanted to show in the standalone.xml is that I have a standard interface and socket binding configuration...

           

          {code:xml}

              <interfaces>

                  <interface name="management">

                      <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>

                  </interface>

                  <interface name="public">

                      <inet-address value="${jboss.bind.address:127.0.0.1}"/>

                  </interface>

                  <interface name="unsecure">

                      <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>

                  </interface>

              </interfaces>

           

           

              <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

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

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

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

                  <socket-binding name="ajp" port="8009"/>

                  <socket-binding name="http" port="8080"/>

                  <socket-binding name="https" port="8443"/>

                  <socket-binding name="osgi-http" interface="management" port="8090"/>

                  <socket-binding name="remoting" port="4447"/>

                  <socket-binding name="txn-recovery-environment" port="4712"/>

                  <socket-binding name="txn-status-manager" port="4713"/>

                  <outbound-socket-binding name="mail-smtp">

                      <remote-destination host="localhost" port="25"/>

                  </outbound-socket-binding>

              </socket-binding-group>

           

          {code}

          In the meanwhile I was looking at the discussion https://community.jboss.org/thread/198443?tstart=0 , in which the question seems not answered.

          Sorry again for the useless info on the configuration file.

           

          A.

          • 2. Re: Cannot connect to remote host using jboss-cli.sh in JBoss 7.1.1.Final
            formica

            I have a further update, I manage to connect from a remote host but WITHOUT the socks proxy (so I'm inside the same network).

            In order to connect via socks in general I set socksProxyHost and socksProxyPort env variables.

            Does this method not work within jboss-cli.sh ?

            I used JAVA_OPTS to insert the 2 variables, as shown in my first post.

             

            A.