10 Replies Latest reply on Dec 2, 2006 12:02 PM by Weston M. Price

    Shutting down JBOSS

    john larsen Newbie


      I've gotten several instances running on one server using:
      $JBOSS_HOME/bin/run.sh -c jb-user1 > /dev/null 2> /dev/null &
      $JBOSS_HOME/bin/run.sh -c jb-user2 > /dev/null 2> /dev/null &
      $JBOSS_HOME/bin/run.sh -c jb-user3 > /dev/null 2> /dev/null &

      Commands are performed by the respective unix user.

      My question is how do you shutdown from the users perspective?

      $JBOSS_HOME/bin/shutdown.sh -s jb-user1 doesn't work.

      (i know it can be done from the jvm-console - but I need the shell equivalent so that I can create startup/shutdown scripts for each user)

      Thanks Much!


        • 1. Re: Shutting down JBOSS
          Weston M. Price Master

          You would need to pass the appropriate JNDI url of the server to the shutdown script. So, it would be something like:

          ./shutdown.sh -s hostname:port

          The name of the server (ie jb-userX) won't work because it's a 'logical' name.

          • 2. Re: Shutting down JBOSS
            john larsen Newbie

            Uhm, its still running.

            Heres what i tried.

            Consider the following port information
            jb-user1 is 8180
            jb-user2 is 8280
            jb-user3 is 8380
            jb-user4 is 8480

            To shudown jb-user3:
            su - user3 for jb-user3
            $JBOSS_HOME/bin/shutdown.sh -s localhost:8380

            Error: Failed to retrieve stub from server localhost:8380

            I'm assuming the port needs to be the http port. JNDI port doesnt work either - can't connect.

            I apologize if this is a relatively dumb question but I am new with this.


            • 3. Re: Shutting down JBOSS
              Weston M. Price Master

              Hi, no problem. Try this

              ./shutdown.sh -s jnp://hostname:<jndi-naming-port>

              I can't remember if we removed the need for the 'jnp://' prefix or not.

              • 4. Re: Shutting down JBOSS
                john larsen Newbie

                Are you referring to this port number: 1400?

                Heres snippet for jb-user3 in the service-binding.xml file:
                <service-config name="jboss:service=HAJNDI"
                <delegate-config portName="Port" hostName="BindAddress">


                Says it couldnt connect - so I have opened 1400 from the firewall - but still did not work.

                I'm gonna have to revisit this issue later - I appreciate your help!

                • 5. Re: Shutting down JBOSS
                  Weston M. Price Master

                  Are you running in a cluster? Your original post did not mention this.

                  The JNDI port is simply the port that your naming service is running on. Typically this is 1099 for each host. However, since you are running multiple instances on one machine it would be whatever JNDI naming port you configured for a particular instance.

                  • 6. Re: Shutting down JBOSS
                    john larsen Newbie

                    No - its not my intention to utilize clusters. That was the entry for jndi in the bind manager.

                    How do I find the jndi port #?


                    • 7. Re: Shutting down JBOSS
                      john larsen Newbie

                      Ah this forum doesn't allow me to edit or delete my own posts.

                      I realized the answer to my question as I clicked on submit - monday morning - what do you expect?


                      • 8. Re: Shutting down JBOSS
                        Peter Johnson Master

                        Don't delete your post, instead if you found the answer post what you did to fix your problem. Then if someone else has the same problem they will also have the answer when they search the forums.

                        • 9. Re: Shutting down JBOSS
                          john larsen Newbie

                          Ok I am back on this problem.

                          Normally, it seems, jboss uses port 1099 for this shutdown process. The instance I am trying to shutdown is 1199 so I have tried the following:

                          (Keep in mind JBOSS runs as jboss user from one directory, and the instance resides in user1's directory and is started as that user1)

                          Try 1:
                          $JBOSS_HOME/bin/shutdown.sh -s localhost:1199
                          Error: Failed to authenticate principal=null, securityDomain=jmx-console

                          Try 2:
                          $JBOSS_HOME/bin/shutdown.sh jnp://localhost:1199
                          Error: same as above plus: Failed to connect to server localhost:1099

                          So Try 2 it shows its still looking for port 1099 which isnt even running.


                          • 10. Re: Shutting down JBOSS
                            Weston M. Price Master

                            Ok, so it looks like your JMX console is secured. Try this:

                            ./shutdown.sh -s jnp://localhost:1199 -u username -p password