8 Replies Latest reply on Sep 16, 2010 10:58 AM by Peter Johnson

    issue in stop running jvm, throwing errors.

    doki kumar Newbie

      Hi,

       

      I am using JBOSS EAP 5.0, and I am trying to  stop a server Instance. To stop I am using "shutdown.sh -s <server Name>, but while shuting down i am getting error as below. So can some one please tell me, what is the issue and reason for this?

       

      Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: JbossServerB [Root exception is javax.naming.CommunicationException: Failed to connect to server JbossServerB:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server JbossServerB:1099 [Root exception is java.net.UnknownHostException: JbossServerB]]]
              at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
              at javax.naming.InitialContext.lookup(InitialContext.java:392)
              at org.jboss.Shutdown.main(Shutdown.java:219)
      Caused by: javax.naming.CommunicationException: Failed to connect to server JbossServerB:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server JbossServerB:1099 [Root exception is java.net.UnknownHostException: JbossServerB]]
              at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)
              at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)
              ... 4 more
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server JbossServerB:1099 [Root exception is java.net.UnknownHostException: JbossServerB]
              at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)
              ... 5 more
      Caused by: java.net.UnknownHostException: JbossServerB
              at java.net.InetAddress.getAllByName0(InetAddress.java:1157)
              at java.net.InetAddress.getAllByName(InetAddress.java:1083)
              at java.net.InetAddress.getAllByName(InetAddress.java:1019)
              at java.net.InetAddress.getByName(InetAddress.java:969)
              at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:81)
              at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301)
              ... 5 more

        • 1. Re: issue in stop running jvm, throwing errors.
          Peter Johnson Master

          How did you start the app server? Did you pass the -b option? See https://www.jboss.org/community/wiki/JBoss42FAQ

           

          Did you change any of the ports that the app server uses?

           

          If the above doesn't help, what OS are you using and what is in your /etc/hosts file?

          • 2. Re: issue in stop running jvm, throwing errors.
            doki kumar Newbie

            Hi,

             

            I have started my JVM using run.sh -b <local IP> -c <JVM Name>, and for the ports I have used the port offset "100". No other changes has been made. The Jboss is running under 64bit Linux system. Also My /etc/host is fine. But still I am getting the same error.

            • 3. Re: issue in stop running jvm, throwing errors.
              jaikiran pai Master

              doki kumar wrote:

               

              Also My /etc/host is fine.

              Please post the contents of that file.

               

              Also what does the following command return from the client machine:

               

              ping JbossServerB

              • 4. Re: issue in stop running jvm, throwing errors.
                jaikiran pai Master

                doki kumar wrote:

                 

                and for the ports I have used the port offset "100".

                Oh wait! So the Naming port is now 1199 and not the default 1099? So your shutdown command should be:

                 

                shutdown.sh -s jnp://JbossServerB:1199

                • 5. Re: issue in stop running jvm, throwing errors.
                  doki kumar Newbie

                  Hi,

                  The above command does not work for me, i got the error below...  I using the port offset "100", so while starting the JVM I am not passing anything and it takes automatically the ports from the port defination defined for the JVM. So expecting, while stopping it should follow the same port defination.

                   

                   

                  ./shutdown.sh -s JbossServerB:1199


                  Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: JbossServerB:1199 [Root exception is javax.naming.CommunicationException: Failed to connect to server JbossServerB:1199 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server JbossServerB:1199 [Root exception is java.net.UnknownHostException: JbossServerB]]]
                  at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
                  at javax.naming.InitialContext.lookup(InitialContext.java:392)
                  at org.jboss.Shutdown.main(Shutdown.java:219)
                  Caused by: javax.naming.CommunicationException: Failed to connect to server JbossServerB:1199 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server JbossServerB:1199 [Root exception is java.net.UnknownHostException: JbossServerB]]
                  at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)
                  at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)
                  ... 4 more
                  Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server JbossServerB:1199 [Root exception is java.net.UnknownHostException: JbossServerB]
                  at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)
                  ... 5 more
                  Caused by: java.net.UnknownHostException: JbossServerB
                  at java.net.InetAddress.getAllByName0(InetAddress.java:1157)
                  at java.net.InetAddress.getAllByName(InetAddress.java:1083)
                  at java.net.InetAddress.getAllByName(InetAddress.java:1019)
                  at java.net.InetAddress.getByName(InetAddress.java:969)
                  at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:81)
                  at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301)
                  ... 5 more

                  • 6. Re: issue in stop running jvm, throwing errors.
                    Peter Johnson Master

                    What Linux distro are you using? Does that Linux distro come with SELinux and is SELinux running?

                     

                    We really need to see your hosts file. Other posters have also claimed that their hosts file is fine, but was in fact incorrect.

                     

                    Do you have a firewall running? If so, what ports do you have open?

                     

                    What happens when you do:  telnet JbossServerB:1199

                     

                    This part of the error suggests that the system on which you are running shutdown does not know who JbossServerB is:

                    >>Caused by: java.net.UnknownHostException: JbossServerB

                    • 7. Re: issue in stop running jvm, throwing errors.
                      doki kumar Newbie

                      Hi,

                       

                      My Jboss is running under standalone linux server and where the SELINUX is DISABLED in /etc/sysconfig/selinux. My host files looks as below and also there is no firewall setup. But when I did "telnet JbossServerB:1199" i got as "JbossServerB:1199/telnet: Name or service not known". So please let me know what is the issue in this.

                       

                      # Do not remove the following line, or various programs
                      # that require network functionality will fail.
                      #127.0.0.1      localhost.localdomain   localhost
                      #::1    localhost6.localdomain6 localdomain6
                      #10.136.229.31 localhost57.xx.xxxxxxx.com
                      10.136.229.104 localhost104.xx.xxxxxxx.com localhost104
                      10.136.229.78 localhost65.xx.xxxxxxx.com localhost65
                      10.136.229.77 localhost57.xx.xxxxxxx.com localhost57
                      10.136.229.59 imstestserver6.xx.xxxxxxx.com imstestserver6

                      • 8. Re: issue in stop running jvm, throwing errors.
                        Peter Johnson Master

                        Sorry, typo in my command. It should have been (no colon):

                         

                        telnet JbossServerB 1199

                         

                        No wonder you are getting a "host not found" exception - your hosts file does not contain any reference to JbossServerB. (I guess I should ask - is the hosts file you posted the one from JbossServerB, where JBoss AS is running, or is it from the system where you ran shutdown? Or is that the same system?)

                         

                        By the way "standalone Linux server" is NOT the name of a distro. So are you running: Fedora? Ubuntu? RHEL? ???