13 Replies Latest reply on Sep 9, 2008 2:04 AM by jaikiran pai

    shutting down jboss server running on a machine having multi

    mahi nath Newbie

      I have JBoss server running on a single machine having multiple IPs (say xxx.xxx.xxx.108,xxx.xxx.xxx.109,and so on), i need to bind my application only to particular IP(say xxx.xxx.xxx.108).

      With respect to this i have referred the below link

      http://wiki.jboss.org/wiki/ConfiguringMultipleJBossInstancesOnOneMachine

      and i tried
      run.bat -c default -b xxx.xxx.xxx.108

      Although the above solution worked for me (i mean i can bind my application to xxx.xxx.xxx.108 IP only ).But the problem is how do i stop that jboss server.

      On the JBoss site (which i have mentioned above)there is info for shutting down different instances if the different instances are using different ports with the "shutdown" command however I couldnt find anything for my situation. In addition to that, the shutdown commands options seem not to support any references to a particular IP address.

      Also i tried ./shutdown.bat -S -s X.X.X.108:8500
      where 8500 is the port on which my application is running.

      with the following results:

      Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.111.108:8500 [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server 192.168.111.108:8500 [Root exception is java.io.EOFException]]

      NOTE : Iam using JBoss 3.2.6 version.

      Please help in this regard. Thanks in advance.

        • 1. Re: shutting down jboss server running on a machine having m
          jaikiran pai Master

           

          Also i tried ./shutdown.bat -S -s X.X.X.108:8500
          where 8500 is the port on which my application is running.


          8500 looks like a http port. You should be using the port to which the Naming service is bound. By default, it is 1099.


          • 2. Re: shutting down jboss server running on a machine having m
            mahi nath Newbie

            Thanks for your prompt reply.

            I tried with 1099 port which you have mentioned but its not working for me.

            Iam here by showing the error what i have got when i tried with 1099

            Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.111.108:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server 192.168.111.108:1099
            [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 192.168.111.108:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]

            Also i noticed that the Naming Service is bound to 1099 in my case.

            Can i have any other way to do this.Thanks in advance.
            Once again thanks for your prompt response.

            • 3. Re: shutting down jboss server running on a machine having m
              jaikiran pai Master

              How did you verify that the Naming service port for this instance is 1099? Can you post the console logs of the server which is started at 192.168.111.108? Also, you can see this for more details http://www.jboss.com/index.html?module=bb&op=viewtopic&t=138054

              • 4. Re: shutting down jboss server running on a machine having m
                mahi nath Newbie

                Good news....
                The link provided by you worked for me....

                Thank you very much for your great help.....Thank you once again..

                • 5. Re: shutting down jboss server running on a machine having m
                  mahi nath Newbie

                  Hi again...
                  I got new problem in shutting down jBoss server in linux machine.
                  As i mentioned earlier


                  I have JBoss server running on a single machine having multiple IPs (say xxx.xxx.xxx.108,xxx.xxx.xxx.109,and so on), i need to bind my application only to particular IP(say xxx.xxx.xxx.108).

                  now i can able to bind my application to single ip in linux but i was not able to shutdown the jboss server.
                  Before binding my application to single IP(i.e;server is bound to all IPs)the shutdown results are as follows:
                  [system@bin] sh run.sh
                  [system@bin]netstat -anp | grep 9170
                  (Not all processes could be identified, non-owned process info
                  will not be shown, you would have to be root to see it all.)
                  tcp 0 0 :::53825 :::* LISTEN 9170/java
                  tcp 0 0 :::33162 :::* LISTEN 9170/java
                  tcp 0 0 :::33515 :::* LISTEN 9170/java
                  tcp 0 0 :::8500 :::* LISTEN 9170/java
                  tcp 0 0 ::ffff:127.0.0.1:57876 ::ffff:127.0.0.1:33336 ESTABLISHED 9170/java
                  tcp 0 0 ::ffff:127.0.0.1:58621 ::ffff:127.0.0.1:33336 ESTABLISHED 9170/java
                  tcp 0 0 ::ffff:127.0.0.1:57022 ::ffff:127.0.0.1:33336 ESTABLISHED 9170/java
                  tcp 0 0 ::ffff:127.0.0.1:50975 ::ffff:127.0.0.1:33336 ESTABLISHED 9170/java
                  udp 0 0 :::1514 :::* 9170/java
                  unix 2 [ ] STREAM CONNECTED 86960 9170/java
                  [system@bin] sh shutdown.sh [Successful]

                  After binding to single IP the shutdown results are shown below :
                  [system@bin] run.sh -c default -b 192.168.111.234
                  [system@bin]netstat -anp | grep 9444
                  (Not all processes could be identified, non-owned process info
                  will not be shown, you would have to be root to see it all.)
                  tcp 0 0 ::ffff:192.168.111.23:39360 :::* LISTEN 9444/java
                  tcp 0 0 ::ffff:192.168.111.23:54371 :::* LISTEN 9444/java
                  tcp 0 0 ::ffff:192.168.111.23:44686 :::* LISTEN 9444/java
                  tcp 0 0 ::ffff:192.168.111.234:8500 :::* LISTEN 9444/java
                  tcp 0 0 ::ffff:127.0.0.1:33209 ::ffff:127.0.0.1:33336 ESTABLISHED 9444/java
                  tcp 0 0 ::ffff:127.0.0.1:60493 ::ffff:127.0.0.1:33336 ESTABLISHED 9444/java
                  tcp 0 0 ::ffff:127.0.0.1:57899 ::ffff:127.0.0.1:33336 ESTABLISHED 9444/java
                  tcp 0 0 ::ffff:127.0.0.1:56898 ::ffff:127.0.0.1:33336 ESTABLISHED 9444/java
                  udp 0 0 :::1514 :::* 9444/java
                  unix 2 [ ] STREAM CONNECTED 96875 9444/java

                  [system@bin] sh shutdown.sh [ failed with ConnectException ]

                  Even tried with the below command : (solution which you have provided me earlier..)
                  [system@bin] sh shutdown.sh -S -s 192.168.111.234:<Naming Service Port>

                  Still iam getting the same error i mean "failed with ConnectException"

                  Also i observed that after i bind to single ip , when i netstat iam not able to see the full ip in the results i dont know why?(see above in quote 3, Actually binded IP is 192.168.111.234 but it is displaying only 192.168.111.23)

                  Please suggest me anything with respect to this....

                  • 6. Re: shutting down jboss server running on a machine having m
                    erasmo2 marciano2 Master

                    Try
                    ./shutdown.bat -H X.X.X.108:8500 787876


                    You kill VM

                    • 7. Re: shutting down jboss server running on a machine having m
                      mahi nath Newbie

                      Thanks for your reply....
                      but unfortunately it didn't work for me.
                      i tried with

                      ./shutdown.sh -H X.X.X.108:8500 787876

                      and i got the error as follows:
                      Exception in thread "main" javax.naming.CommunicationException: Could not obtain
                      connection to any of these urls: localhost:34446 [Root exception is javax.namin
                      g.CommunicationException: Failed to connect to server localhost:34446 [Root exce
                      ption is javax.naming.ServiceUnavailableException: Failed to connect to server l
                      ocalhost:34446 [Root exception is java.net.ConnectException: Connection refused]
                      ]]
                      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1202)
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516)
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
                      at javax.naming.InitialContext.lookup(Unknown Source)
                      at org.jboss.Shutdown.main(Shutdown.java:188)
                      Caused by: javax.naming.CommunicationException: Failed to connect to server loca
                      lhost:34446 [Root exception is javax.naming.ServiceUnavailableException: Failed
                      to connect to server localhost:34446 [Root exception is java.net.ConnectExceptio
                      n: Connection refused]]
                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:213)
                      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1187)
                      ... 4 more
                      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server
                      localhost:34446 [Root exception is java.net.ConnectException: Connection refuse
                      d]
                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:187)
                      ... 5 more
                      Caused by: java.net.ConnectException: Connection refused
                      at java.net.PlainSocketImpl.socketConnect(Native Method)
                      at java.net.PlainSocketImpl.doConnect(Unknown Source)
                      at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
                      at java.net.PlainSocketImpl.connect(Unknown Source)
                      at java.net.SocksSocketImpl.connect(Unknown Source)
                      at java.net.Socket.connect(Unknown Source)
                      at java.net.Socket.connect(Unknown Source)
                      at java.net.Socket.<init>(Unknown Source)
                      at java.net.Socket.<init>(Unknown Source)
                      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory
                      .java:69)
                      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory
                      .java:62)
                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:183)
                      ... 5 more


                      Also i tried with naming service port(34446) instead of port 8500 and iam getting the same error(mentioned above).

                      Please could you suggest me any other way.
                      Your response will be highly appreciated.
                      Thanks in advance.

                      • 8. Re: shutting down jboss server running on a machine having m
                        Peter Johnson Master

                        I think that you /hosts/etc file is not correct. It needs to contain a line such as:

                        192.168.111.234 myhostname

                        where myhostname is the name that shows up when you run the "uname hostname" command.

                        Then you should be able to run:

                        sh shutdown.sh -S -s 192.168.111.234:<Naming Service Port>

                        • 9. Re: shutting down jboss server running on a machine having m
                          erasmo2 marciano2 Master

                          Sorry
                          try
                          ./shutdown.sh -H X.X.X.108:1099 23233

                          the port 1099 is default JNDI

                          • 10. Re: shutting down jboss server running on a machine having m
                            mahi nath Newbie

                            Thanks every one for replying me.

                            Sir, i tried with all the following ways which you have suggested me.

                            ./shutdown.sh -H X.X.X.108:1099 23233


                            sh shutdown.sh -H <ip address>:<jndi port> 23233


                            sh shutdown.sh -S -s 192.168.111.234:<Naming Service Port>


                            and
                            ./shutdown.bat -H X.X.X.108:8500 787876


                            As mentioned in one of the replies i also added the line in etc/hosts file.
                            Contents of /etc/hosts file, after i added the line is as below:
                            127.0.0.1 <host-name> localhost
                            192.168.111.234 <host-name>


                            but unfortunately iam getting the same error which i have mentioned earlier.

                            sir, could i know what does 787876 and 23233 actually mean in the replies provided by you.

                            FYI....
                            1. JBoss server not started as "root".
                            2. Iam Using JBoss [WonderLand] 3.2.6 (build: CVSTag=JBoss_3_2_6 date=200410140106).

                            Please suggest me any other way.
                            Thanks in advance.





                            • 11. Re: shutting down jboss server running on a machine having m
                              Peter Johnson Master

                              Do this. Open a terminal windows, cd to the bin directory and enter:

                              ./shutdown.sh

                              Read the description of the various options.

                              If you started the app server with the option "-b 192.168.111.234", then any of the shutdown commands that contain the option "-s 192.168.111.234:<jndi-port>" should work, provided that the JNDI port is open in the firewall.

                              Try running this:

                              telnet 192.168.111.234 <jndi-port>

                              what do you get? The last line should look something like this:

                              UnicastRef2192.168.111.234-gibberish-

                              The IP addresses should match





                              • 12. Re: shutting down jboss server running on a machine having m
                                mahi nath Newbie

                                Thanks again for your reply.
                                Sir , i tried with

                                telnet 192.168.117.134 <jndi-port>

                                and the result i got is as below:
                                suse-linux:/home/FWAnalyzer/Firewall/bin # telnet 192.168.117.134 35415
                                Trying 192.168.117.134...
                                Connected to 192.168.117.134.
                                Escape character is '^]'.
                                ¼φsr↓java.rmi.MarshalledObject|╜▲ùφc�>☻♥I♦hashlocBytest☻[BobjBytesq~☺xp#¥:âpur☻[
                                B¼≤↨°Tα☻xp╞¼φsr org.jnp.server.NamingServer_Stub☻☻xrjava.rmi.server.RemoteStubΘ■
                                e☻xr∟java.rmi.server.RemoteObject╙a┤æ
                                a3▲♥xpw:
                                UnicastRef2192.168.117.134èV=∙�¢☺∟E
                                o┌.ÇxConnection closed by foreign host.

                                Later i tried to connect again using various ways as below:
                                telnet 192.168.117.134 <jndi-port>
                                telnet 127.0.0.1 <jndi-port>
                                telnet 0.0.0.0 <jndi-port>

                                but the result iam getting is as below:
                                telnet: connect to address <ip-address>: Connection refused

                                here <ip-address> in the sense 192.168.117.134 or 127.0.0.1 or 0.0.0.0 which i have given to telnet.

                                Note:
                                I tried all these things while all the ports are connected.

                                Iam here by showing you all the ports which are connected for your reference:

                                tcp 0 0 192.168.117.134:8500 :::* LISTEN
                                28279/java
                                tcp 0 0 192.168.117.134:35414 :::* LISTEN
                                28279/java
                                tcp 0 0 192.168.117.134:35415 :::* LISTEN
                                28279/java
                                tcp 0 0 192.168.117.134:35416 :::* LISTEN
                                28279/java
                                tcp 0 0 127.0.0.1:35421 127.0.0.1:33336 ESTABLISHED
                                28279/java
                                udp 0 0 :::514 :::*
                                28279/java
                                udp 0 0 :::1514 :::*
                                28279/java
                                unix 2 [ ] STREAM CONNECTED 23342960 28279/java


                                Please provide me any suggestion.
                                Thanks in advance.

                                • 13. Re: shutting down jboss server running on a machine having m
                                  jaikiran pai Master

                                  Now that the telnet has responded on 192.168.117.134 at port 35415, next try this:

                                  shutdown.sh -S -s 192.168.117.134:35415