10 Replies Latest reply on Jul 31, 2014 5:31 AM by Sandeep Kumar

    shutdown.sh not found

    Upen Gan Newbie

      Hi,

      Thanks for the free app server.

       

      I am really hesitant to write this as this may turn out to be something wrong I am doing. I get following message when I try stop stop  AS.

       

      /home/jboss/jboss-as-7.1.1.Final/bin/shutdown.sh: No such file or directory

       

      ls -al /home/jboss/jboss-as-7.1.1.Final/bin

      total 144

      drwxr-xr-x  4 jboss jboss 4096 Apr 12 14:42 .

      drwxr-xr-x 10 jboss jboss 4096 Mar 10 00:14 ..

      -rw-r--r--  1 jboss jboss 1922 Mar 10 00:14 add-user.bat

      -rwxr-xr-x  1 jboss jboss 2032 Mar 10 00:14 add-user.sh

      -rw-r--r--  1 jboss jboss 2597 Mar 10 00:14 appclient.bat

      -rw-r--r--  1 jboss jboss 1941 Mar 10 00:14 appclient.conf

      -rw-r--r--  1 jboss jboss 2670 Mar 10 00:14 appclient.conf.bat

      -rwxr-xr-x  1 jboss jboss 3700 Mar 10 00:14 appclient.sh

      drwxr-xr-x  2 jboss jboss 4096 Apr 12 14:41 client

      -rw-r--r--  1 jboss jboss 3589 Mar 10 00:14 domain.bat

      -rw-r--r--  1 jboss jboss 2681 Mar 10 00:14 domain.conf

      -rw-r--r--  1 jboss jboss 3489 Mar 10 00:14 domain.conf.bat

      -rwxr-xr-x  1 jboss jboss 7885 Mar 10 00:14 domain.sh

      drwxr-xr-x  2 jboss jboss 4096 Apr 12 14:42 init.d

      -rw-r--r--  1 jboss jboss 1609 Mar 10 00:14 jboss-cli.bat

      -rwxr-xr-x  1 jboss jboss 1825 Mar 10 00:14 jboss-cli.sh

      -rw-r--r--  1 jboss jboss  611 Mar 10 00:14 jboss-cli.xml

      -rw-r--r--  1 jboss jboss 2370 Mar 10 00:14 jconsole.bat

      -rwxr-xr-x  1 jboss jboss 2309 Mar 10 00:14 jconsole.sh

      -rw-r--r--  1 jboss jboss 2087 Mar 10 00:14 jdr.bat

      -rwxr-xr-x  1 jboss jboss 2092 Mar 10 00:14 jdr.sh

      -rw-r--r--  1 jboss jboss  387 Mar 10 00:14 run.bat

      -rwxr-xr-x  1 jboss jboss  385 Mar 10 00:14 run.sh

      -rw-r--r--  1 jboss jboss 4097 Mar 10 00:14 standalone.bat

      -rw-r--r--  1 jboss jboss 2246 Mar 10 00:14 standalone.conf

      -rw-r--r--  1 jboss jboss 3007 Mar 10 00:14 standalone.conf.bat

      -rwxr-xr-x  1 jboss jboss 7563 Mar 10 00:14 standalone.sh

      -rw-r--r--  1 jboss jboss 1256 Mar 10 00:14 vault.bat

      -rwxr-xr-x  1 jboss jboss 2904 Mar 10 00:14 vault.sh

      -rw-r--r--  1 jboss jboss  811 Mar 10 00:14 wsconsume.bat

      -rwxr-xr-x  1 jboss jboss 2255 Mar 10 00:14 wsconsume.sh

      -rw-r--r--  1 jboss jboss  750 Mar 10 00:14 wsprovide.bat

      -rwxr-xr-x  1 jboss jboss 2077 Mar 10 00:14 wsprovide.sh

       

      Tried downloading zip as well as compresses tar archive(tar.gz) I don't see the shutdown.sh file. How is AS supposed to be shutdown in newest Final version?

       

      Thanks,

      Upen

        • 1. Re: shutdown.sh not found
          Upen Gan Newbie

          Sorry. Forgot to read last line in README file.

           

          $JBOSS_HOME/bin/jboss-cli.sh --connect --command=:shutdown

           

          So I ran above command, but I get

          $JBOSS_HOME/bin/jboss-cli.sh --connect --command=:shutdown

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

           

          /etc/init.d/jboss start

          * WARNING: jboss has already been started

          • 2. Re: shutdown.sh not found
            James Perkins Master

            Can you paste the /etc/init.d/jboss script?

            • 3. Re: shutdown.sh not found
              Upen Gan Newbie

              Hi James,

               

              Here is the o/p

               

              #! /bin/sh

               

              start(){

                  echo "Starting JBoss 7"

                      sudo -u jboss sh /home/jboss/jboss-as-7.1.1.Final/bin/standalone.sh > /dev/null 2>&1 &

              }

               

              stop(){

                  echo "Stopping JBoss 7"

                      sudo -u jboss sh /home/jboss/jboss-as-7.1.1.Final/bin/jboss-cli.sh --connect command=:shutdown

              }

               

              restart(){

                  stop

              # give stuff some time to stop before we restart

                      sleep 60

              # protect against any services that can't stop before we restart

                      su -l jboss -c 'killall java'

                      start

              }

               

              case "$1" in

              start)

              start

              ;;

              stop)

              stop

              ;;

              restart)

              restart

              ;;

              *)

              echo "Usage: jboss {start|stop|restart}"

              exit 1

              ;;

              esac

              • 4. Re: shutdown.sh not found
                James Perkins Master

                That seems to be working for me. I did get that error message once, but it was because I didn't wait long enough for the sever to start.

                • 5. Re: shutdown.sh not found
                  Upen Gan Newbie

                  Yep, Looks like it's working for me too. Earlier I had below scripts which was completely wrong. It was gentoo style. This was the reference for that http://www.waynestenson.com/doc/HOWTO/How-to JBoss on Gentoo.html

                   

                   

                   

                  #!/sbin/runscript

                  # Copyright 1999-2010 Gentoo Foundation

                  # Distributed under the terms of the GNU General Public License v2

                  # $Header: $

                   

                  JBOSS_HOME="/home/jboss/jboss-as-7.1.1.Final"

                  JBOSS_START="bin/run.sh"

                  JBOSS_STOP="bin/shutdown.sh"

                  JBOSS_GROUP="jboss"

                   

                  depend() {

                          need net

                          use dns

                  }

                   

                  start() {

                          ebegin "Starting JBoss Application Server" # __JBOSS_VER__"

                          # make sure Java stuff is set.

                          start-stop-daemon --start --background -g "${JBOSS_GROUP}" \

                                  -u "${JBOSS_USER}" --exec "${JBOSS_HOME}/${JBOSS_START}" \

                                  -- ${JBOSS_OPTIONS}

                          eend ${?}

                  }

                   

                  stop() {

                          ebegin "Stopping JBoss Application Server" # __JBOSS_VER__"

                          "${JBOSS_HOME}/${JBOSS_STOP}" -S

                          eend ${?}

                          # Sorry, wait for server shutdown

                          sleep "${SHUTDOWN_SECS}"

                  }

                  • 6. Re: shutdown.sh not found
                    James Perkins Master

                    The new one looks much better :-) I would personally however use the JBOSS_HOME bit just so it's easier to change in the future, but that's just me.

                     

                     

                    #! /bin/sh 
                    
                    if [ "x$JBOSS_HOME" = "x" ]; then
                        JBOSS_HOME="/home/jboss/jboss-as-7.1.1.Final"
                    fi 
                    
                    start(){
                        echo "Starting JBoss 7"
                            "$JBOSS_HOME/bin/standalone.sh" > /dev/null 2>&1 &
                    } 
                    
                    stop(){
                        echo "Stopping JBoss 7"
                             "$JBOSS_HOME/bin/jboss-cli.sh" --connect command=:shutdown
                    } 
                    
                    restart(){
                        echo "Does nothing currently"
                    } 
                    
                    case "$1" in
                    start)
                    start
                    ;;
                    stop)
                    stop
                    ;;
                    restart)
                    restart
                    ;;
                    *)
                    echo "Usage: jboss {start|stop|restart}"
                    exit 1
                    ;;
                    esac
                    
                    
                    1 of 1 people found this helpful
                    • 7. Re: shutdown.sh not found
                      Upen Gan Newbie

                      Yes. Point taken. Thanks.

                       

                      Actually just seeing how jboss looks and what it is . Btw, do you know of any docuement on web which shows how to connect to MySQL from Jboss. I know how to do that with tomcat but jboss

                       

                      Thanks!

                      • 8. Re: shutdown.sh not found
                        James Perkins Master

                        Indeed there is https://community.jboss.org/wiki/DataSourceConfigurationInAS7. Pay attention to the part about installing it as a module. This is important for MySQL since it's not a JDBC 4 compliant driver. Here is some more general information about datasources https://docs.jboss.org/author/display/AS71/DataSource+configuration.

                        • 9. Re: shutdown.sh not found
                          Upen Gan Newbie

                          Thanks again. Have a nice day.

                          • 10. Re: shutdown.sh not found
                            Sandeep Kumar Newbie

                            Hi,

                            I am using the below script start "cmd /c c:\Temp\JBoss\jboss-as-7.1.1.Final\bin\jboss-cli.bat --connect command=/host=*:shutdown" to stop and I was getting the exception as below but the same script is working good if I do in some other machine do I need to do anything in the failing machine ,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