catch(NotBoundException e) { log.info("Cannot lookup " + name + ", the server is probably shut down already"); return; }
   public static void main(String[] args) throws Exception   {      String host = System.getProperty("test.bind.address");      if (host == null)      {         host = "localhost";      }            int index;      String serverIndex = System.getProperty("test.server.index");      if (serverIndex == null)      {         index = RMITestServer.DEFAULT_SERVER_INDEX;      }      else      {         index = Integer.parseInt(serverIndex);      }      String name =         "//" + host + ":" + RMITestServer.DEFAULT_REGISTRY_PORT + "/" +         RMITestServer.RMI_SERVER_PREFIX + index;      log.info("Stopping " + name);      Server server;      try      {         server = (Server)Naming.lookup(name);      }      catch(ConnectException e)      {         log.info("Cannot contact the registry, the server is probably shut down already");         return;      }      // We should shut down cleanly - not kill the process like we are currently doing            server.kill();      // The last RMI server will take with it the registry too      log.info("RMI server stopped");   }