4 Replies Latest reply on Aug 6, 2004 4:40 AM by gratcliffe

    Problem stopping JBoss: wrong port number

    scottymo

      I have an instance of JBoss running on Solaris which I am not able to stop using bin/shutdown.sh -S. Running shutdown.sh -S shows:
      Failed to connect to server localhost:1099

      What I don't understand is where shutdown.sh is getting the port number 1099. We have our jboss-service.xml to use port 10990 for the NamingService, not 1099. Running netstat -a shows something listening to 10990, and not 1099 (as expected).

      I have 2 questions:
      - Where does shutdown.sh obtain the port number it tries to use when shutting down JBoss?
      - As an alternative to a normal shutdown, is it safe to simply kill the Java process that is running JBoss and the shell process running bin/run.sh?

      Any help you could provide would be greatly appreciated.

      Thanks!
      Scott.

        • 1. Re: Problem stopping JBoss: wrong port number
          aalmero

          you can use this script below.

          #!/sbin/sh
          case "$1" in
          'start')
           echo "Starting Jboss Server"
           /usr/jboss/bin/run.sh>&1 | tee /var/log/jboss &
           ;;
          'stop')
           echo "Stopping Jboss Server"
          # PID = /usr/bin/pgrep java
           /usr/bin/pkill -9 java
           ;;
          *)
           echo "Usage: $0 { start | stop }"
           exit 1
           ;;
          esac
          exit 0
          



          hth
          aalmero


          • 2. Re: Problem stopping JBoss: wrong port number

            In the bin directory there is a shutdown.jar. If you look in this you will see
            there is a jndi.properties file. It contains localhoat:1099. If you use
            shutdown.sh or shutdown.bat it will use the file unless you ensure another version, that can contain the correct host/port, is found first.

            Note that using this method of shutting JBoss down is a 'polite' request via JMX. If things have gone badly wrong it may not work. The other poster showed a better approach for Unix. For Windows I would suggest the Java Wrapper service. Details in the wiki I think.

            Gary

            • 3. Re: Problem stopping JBoss: wrong port number
              genman

              Last line of shutdown.sh, you can specify the port number to use:

              org.jboss.Shutdown -S -s jnp://localhost:10990

              • 4. Re: Problem stopping JBoss: wrong port number

                Thanks for the -s tip.

                Didn't know about that.