3 Replies Latest reply on Mar 8, 2004 3:00 PM by dbronk

    Can't shutdown when running multiple instances

    dbronk

      Windows 2000 server
      JBoss 3.2.3
      Setup my service-binding.xml as in the example and it is working great. My basic setup is that I have the default server setup in the service-binding.xml and for each additional instance I need I simply copy the default server and paste it in the same file, then change the name and simply increment each port by 100 from the last. Again, starting up multiple instances works great.

      Example: Default naming port 1099, default rmi port 1098
      defaultE2RD naming port 1199, defaultE2RD rmi port 1198

      My problem is shutting down. The only option for me is ctrl+c but that sucks as I want to have scripts to deploy, stop, start, etc.

      The shutdown command I enter is:
      C:\jboss-3.2.3\bin\shutdown.bat --server=defaultE2RD
      Note: I also don't know the command to stop/start remotely.
      The exception I get is below
      Note: it is trying to connect to defaultE2RD:1099, it should use the service-binding.xml and connect to defaultE2RD:1199

      What do I need to enter for shutdown? Added bonus... How to do it remotely?

      Thanks,
      Dale

      10:33:00,231 WARN [NamingContext] Failed to connect to defaultE2RD:1099
      javax.naming.CommunicationException: Failed to connect to server defaultE2RD:1099 [Root exception is
      javax.naming.ServiceUnavailableException: Failed to connect to server defaultE2RD:1099 [Root except
      ion is java.net.UnknownHostException: defaultE2RD: defaultE2RD]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:215)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1181)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at org.jboss.Shutdown.main(Shutdown.java:182)
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server defaultE2RD:1099 [R
      oot exception is java.net.UnknownHostException: defaultE2RD: defaultE2RD]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:190)
      ... 5 more
      Caused by: java.net.UnknownHostException: defaultE2RD: defaultE2RD
      at java.net.InetAddress.getAllByName0(InetAddress.java:1011)
      at java.net.InetAddress.getAllByName0(InetAddress.java:981)
      at java.net.InetAddress.getAllByName(InetAddress.java:975)
      at java.net.InetAddress.getByName(InetAddress.java:889)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:61)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:186)
      ... 5 more
      Exception in thread "main" java.lang.ClassCastException
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:986)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1192)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at org.jboss.Shutdown.main(Shutdown.java:182)

        • 1. Re: Can't shutdown when running multiple instances
          mmenz

          Hi Dale,
          try this one:
          shutdown.sh --server=localhost:1099 --serverName=jboss.system:type=Server
          where 1099 is your jnp port (see your server.log)

          Matt

          • 2. Re: Can't shutdown when running multiple instances
            dbronk

            Different exception so I guess we are making progress. I entered:

            C:\jboss-3.2.3\bin\shutdown.bat --server=localhost:1199 --serverName=jboss.system:type=Server

            (1199 is the naming port for this server)
            and received

            Exception in thread "main" javax.management.MalformedObjectNameException: malformed key/value pair:
            type
            at javax.management.ObjectName.initProperties(ObjectName.java:283)
            at javax.management.ObjectName.init(ObjectName.java:208)
            at javax.management.ObjectName.(ObjectName.java:87)
            at org.jboss.Shutdown.main(Shutdown.java:144)

            The --server=localhost:1199 --serverName=jboss.system:type=Server doesn't look correct to me. I also tried

            C:\jboss-3.2.3\bin\shutdown.bat --server=defaultE2RD:1199

            and received

            10:45:35,413 WARN [NamingContext] Failed to connect to defaultE2RD:1199
            javax.naming.CommunicationException: Failed to connect to server defaultE2RD:1199 [Root exception is
            javax.naming.ServiceUnavailableException: Failed to connect to server defaultE2RD:1199 [Root except
            ion is java.net.UnknownHostException: defaultE2RD: defaultE2RD]]
            at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:215)
            at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1181)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at org.jboss.Shutdown.main(Shutdown.java:182)
            Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server defaultE2RD:1199 [R
            oot exception is java.net.UnknownHostException: defaultE2RD: defaultE2RD]
            at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:190)
            ... 5 more
            Caused by: java.net.UnknownHostException: defaultE2RD: defaultE2RD
            at java.net.InetAddress.getAllByName0(InetAddress.java:1011)
            at java.net.InetAddress.getAllByName0(InetAddress.java:981)
            at java.net.InetAddress.getAllByName(InetAddress.java:975)
            at java.net.InetAddress.getByName(InetAddress.java:889)
            at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:61)
            at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:186)
            ... 5 more
            Exception in thread "main" java.lang.ClassCastException
            at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:986)
            at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1192)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at org.jboss.Shutdown.main(Shutdown.java:182)

            Simply not sure why it doesn't use the service-binding.xml like the startup does.

            Thanks,
            Dale

            • 3. Re: Can't shutdown when running multiple instances
              dbronk

              Anyone have any ideas?