title: HelloRMIServer cannot connect in bind()
body: <p>Doing a course, and I am trying to wrap my head around RMI. I cant seem to get it right. Link to unmodified source code: <a href="https://drive.google.com/open?id=0B7NQABLlsgGWbXNhb0JHall4NXM" rel="nofollow noreferrer">https://drive.google.com/open?id=0B7NQABLlsgGWbXNhb0JHall4NXM</a></p>
  
  <pre><code>package helloworld;
  
  import java.rmi.Naming;
  
  public class HelloRMIServer {
  
  // TODO 08. Set the OBJECT_NAME to the same value used by the client.
  private static String OBJECT_NAME = "TEST";
  
  public static void main(String[] args) {
      try {
          // TODO 09. Create a new instance of the remote object.
          MessageInterface message = new MessageInterface();
          // TODO 10. Re-bind the object in the registry.
          Naming.rebind("rmi://" + "127.0.0.1" + "/" + OBJECT_NAME, message);
          System.out.println("Server object message bound into registry.");
      } catch (Exception e) {
          e.printStackTrace();
      }
      System.out.println("Server done creating and binding objects.");
      }
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>