title: How to resolve java.rmi.NotBoundException: rmi://localhost//HelloWorld?
body: <p>Im starting to use Java RMI. Im tried to do an Hello World example but i didn't.
  This is my remote interface code:</p>
  
  <pre><code>package server;
  
  import java.rmi.Remote;
  import java.rmi.RemoteException;
  
  public interface Hello extends Remote
  {
      public String saluta(String who) throws RemoteException;
  }
  </code></pre>
  
  <p>This is my class that extends the remote interface:</p>
  
  <pre><code>package server;
  
  import java.rmi.RemoteException;
  import java.rmi.server.UnicastRemoteObject;
  
  public class HelloWorld extends UnicastRemoteObject implements Hello
  {
  
      private static final long serialVersionUID = 1L;
  
      public HelloWorld() throws RemoteException
      {
          super();
      }
  
      public String saluta(String who) throws RemoteException
      {
          return "Hello " + who;
      }
  }
  </code></pre>
  
  <p>This is my server:</p>
  
  <pre><code>package server;
  import java.rmi.registry.LocateRegistry;
  import java.rmi.registry.Registry;
  import java.rmi.server.UnicastRemoteObject;
  import java.util.logging.Logger;
  
  public class Server
  {
  
      static Logger logger = Logger.getLogger("global");
  
      public static void main(String[] args)
      {
          System.setProperty("java.security.policy", "policy.all");
          if (System.getSecurityManager() == null)
          {
              System.setSecurityManager(new SecurityManager());
          }
  
          try
          {
              HelloWorld hello = new HelloWorld();
  
              Registry r = LocateRegistry.createRegistry(9000);
  
  
              logger.info("Creo l'oggetto");
  
  
              logger.info("...ora ne effettuo il rebind...");
              r.rebind("HelloWorld", hello);
              logger.info("...pronto");
          } catch (Exception e)
          {
              e.printStackTrace();
          }
  
      }
  
  }
  </code></pre>
  
  <p>And this is my client code:</p>
  
  <pre><code>package hello.client;
  import java.rmi.registry.LocateRegistry;
  import java.rmi.registry.Registry;
  import java.util.logging.Logger;
  
  public class Client
  {
      static Logger logger = Logger.getLogger("global");
  
      public static void main(String[] args)
      {
          try
          {
              Registry r = LocateRegistry.getRegistry(9000);
              logger.info("Sto cercando l'oggetto remoto...");
              Hello hello = (Hello) r.lookup("rmi://localhost//HelloWorld");
  
  
              System.out.println(hello.saluta("Graziano"));
  
          } catch (Exception e)
          {
              e.printStackTrace();
          }
  
      }
  
  }
  </code></pre>
  
  <p>I created two separeted project,one for server and the other one for client as in image at following link:<a href="http://www.mediafire.com/view/h5pvug5r2cqlamv/Immagine.png" rel="nofollow">image</a>
  My server work perfectly, but the client get me this error:
  java.rmi.NotBoundException: rmi://localhost//HelloWorld on line 18</p>
  
  <p>what's wrong?? If someone can, please post me an example! Thanks :D</p>
  
  <p>P.S: Maybe could be important! This is the external configuration tool:
  <a href="http://www.mediafire.com/view/qzoipupq74870cu/Immagine2.png" rel="nofollow">image2</a></p>