8 Replies Latest reply: Jul 31, 2014 5:54 AM by Lalit Shaktawat RSS

    Configure JBoss AS7 listening and how to stop JBoss?

    Newbie

      Hi,

       

      I've configured JBoss AS7 to listen as follows:

       

          <interfaces>

              <interface name="management">

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

              </interface>

              <interface name="public">

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

              </interface>

              <!-- TODO - only show this if the jacorb subsystem is added  -->

              <interface name="unsecure">

                  <!--

                    ~  Used for IIOP sockets in the standard configuration.

                    ~                  To secure JacORB you need to setup SSL

                    -->

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

              </interface>

          </interfaces>

       

      and I can connect to it using either localhost or IP address.

       

      However, I can't figure out how to shutdown JBoss, e.g.:

       

      [root@jboss bin]# ./jboss-cli.sh --connect command=:shutdown --controller=192.168.0.213:9999

       

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

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

              ... 8 more

       

       

      I also tried "localhost:9999" and got the same problem.

       

      When I do netstat, I can see listening on 0.0.0.0:9999.

       

      How can I shutdown JBoss?

       

      Thanks,

      Jim

        • 1. Re: Configure JBoss AS7 listening and how to stop JBoss?
          Sudhakar Pyndi Newbie

          Jim,

           

          Were you able to fix this issue? I'm running into this same exception, so wondering on a solution.

           

          Thank you,

          Sudhakar

          • 2. Re: Configure JBoss AS7 listening and how to stop JBoss?
            Dedy S Newbie

            @Jim

            you can try this

             

            ./jboss-cli.sh --connect controller=0.0.0.0:9999 command=:shutdown

             

            it's IP based on this

             

            <interfaces>

                    <interface name="management">

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

                    </interface>

                    <interface name="public">

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

                    </interface>

                    <!-- TODO - only show this if the jacorb subsystem is added  -->

                    <interface name="unsecure">

                        <!--

                          ~  Used for IIOP sockets in the standard configuration.

                          ~                  To secure JacORB you need to setup SSL

                          -->

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

                    </interface>

                </interfaces>

             

            @Sudhakar

            May be my answer on Jim can solve your problem too

            • 3. Re: Configure JBoss AS7 listening and how to stop JBoss?
              Sudhakar Pyndi Newbie

              Dedy,

               

              I'm using the jboss-cli (as you have specified) to shutdown the server, but it still throws the exception and doesn't shutdown.

               

              Thank you,

              Sudhakar

              • 4. Re: Configure JBoss AS7 listening and how to stop JBoss?
                Dedy S Newbie

                Is the exception message changing from before? If it change please what is now?

                 

                Can you show me what are you change at the xml?

                • 5. Re: Configure JBoss AS7 listening and how to stop JBoss?
                  Nicklas Karlsson Master

                  And you have no JBOSS_HOME or other env var that might interfere?

                  • 6. Re: Configure JBoss AS7 listening and how to stop JBoss?
                    Steffen Krause Newbie

                    Out of curiousity, could you start your AS7 with the parameters -b 0.0.0.0 and -Djboss.bind.address.management=0.0.0.0 and then try to shutdown the server via CLI?

                     

                    I know you have configured the default binding address to be 0.0.0.0 in your XML but I'm just wondering if somehow the listener chooses to go back to 127.0.0.1

                     

                    Just a thought,

                     

                    Steffen

                    • 7. Re: Configure JBoss AS7 listening and how to stop JBoss?
                      Sandeep Kumar Newbie

                      Hi,

                       

                      I was running two commands in my automation script

                      1.start cmd /c c:\Temp\JBoss\jboss-as-7.1.1.Final\bin\jboss-cli.bat --connect controller=127.0.0.1:9999 command=:shutdown

                      2.start "JBOSSSERVER" cmd /c c:\Temp\jboss\jboss-as-7.1.1.Final\bin\domain.bat -b 0.0.0.0 -bmanagement 0.0.0.0

                       

                      And while my script is deploying the war it is not able to deploy the war file and throwing the following exception and the same script is working good while using in some other machine I there any environment variables issue can any one help regarding this .

                      thanks in advance...

                       

                       

                       

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

                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

                      sorImpl.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 availabl

                      e at localhost:9999

                              at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandCon

                      textImpl.java:639)

                              at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandCon

                      textImpl.java:613)

                              at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java

                      :227)

                              ... 8 more

                      • 8. Re: Configure JBoss AS7 listening and how to stop JBoss?
                        Lalit Shaktawat Newbie

                        Hi Sandeep

                         

                        I found that this is a bugs in JBoss AS7. It fixed with wildfly -8 Version. So Don't try this for shut down. JBoss with Management CLI. You can sipmly shut down JBoss AS using of management Console or Press CTRL + C.

                        For war deployment issue. Just copy your war file into deploy folder and restart your JBoss AS. Lot of method is available to deploy war into JBoss. If you are using Management CLI. You have follow some steps. For Management console is also simple one process to deploy war into JBoss As.

                         

                        Thanks

                         

                        Lalit