3 Replies Latest reply on Mar 9, 2013 12:25 AM by jaysensharma

    Cannot shutdown Jboss with admin port on 9991

    felipe.gdr

      Hi!

       

      I've have a Jboss started on a server, the HTTP port is 8081, admin port is 9991. I'm able to browse to both addresses like so: localhost:8081 and localhost:9991.

       

      I'm trying to stop it using the command bellow (windows):

       

      jboss-cli.bat --connect controller=localhost:9991 command=:shutdown

       

       

      But I get the following error:

       

      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:195)

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

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

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

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

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

              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 localhost:9991

              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)

              ... 8 more

       

       

      Is there any way of stoping this instance (without restarting the machine).

       

       

      Cheers!!!

        • 1. Re: Cannot shutdown Jboss with admin port on 9991
          dlofthouse

          Are you sure port 9991 is assigned to the native management interface and not the http management interface?  The CLI needs to connect to the native one.

           

          The stack trace looks as though the CLI did not receive a message from the server which would be indicative of connecting to the http interface.

          1 of 1 people found this helpful
          • 2. Re: Cannot shutdown Jboss with admin port on 9991
            felipe.gdr

            Thanks for the reply Darran,

             

            I am not really sure whether this port is assigned to the native or http interface. Is there a way to check that?

             

            I have started JBoss using this property:

             

            -Djboss.socket.binding.port-offset=1

             

            And the starting log is the following:

             

            21:24:22,527 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

            21:24:22,687 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--127.0.0.1-8081

            21:24:23,383 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

            21:24:23,416 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-5) JBoss Web Services - Stack CXF Server 4.0.2.GA

            21:24:23,686 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory /Users/felipereis/Documents/workspace-populisII-git/populisII-repo/populisII-ejb/target/jboss-as-7.1.1.Final/standalone/deployments

            21:24:23,697 INFO  [org.jboss.as.remoting] (MSC service thread 1-8) JBAS017100: Listening on /127.0.0.1:4448

            21:24:23,697 INFO  [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on /127.0.0.1:10000

            21:24:23,875 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9991

            21:24:23,876 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 5756ms - Started 133 of 208 services (74 services are passive or on-demand)

            • 3. Re: Cannot shutdown Jboss with admin port on 9991
              jaysensharma

              Hi,

               

                  You can see the socket binding section in your  "standalone*.xml" file.   something as following:

               

                  <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>
              

               

               

              Here  Following socket Binding is "Management-native"  (default value=9999)

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

               

               

              So when you use   -Djboss.socket.binding.port-offset=1   So all those mentioned ports will be incremented by +1

              Means your Native Management Port will be   = (9999+1)  which means 10000

               

               

              So you should use:

               

              jboss-cli.bat --connect controller=localhost:10000 command=:shutdown