title: RMI: ServerException, RemoteException, UnmarshalException, UnmarshalException
body: <p>I followed this tutorial: <a href="https://docs.oracle.com/javase/6/docs/technotes/guides/rmi/hello/hello-world.html#5" rel="nofollow noreferrer">https://docs.oracle.com/javase/6/docs/technotes/guides/rmi/hello/hello-world.html#5</a></p>
  
  <p>I compiled them at command prompt and after that I started rmiregistry. Then, after I typed: </p>
  
  <pre><code>    start java -classpath "." example.Server
  </code></pre>
  
  <p>it didn't show "Server ready." But, it didn't display any errors as well.</p>
  
  <p>While when I tried it at Eclipse, it showed this:</p>
  
  <pre><code>  Server exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
  java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
  java.lang.ClassNotFoundException: example.Hello
      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
  java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
  java.lang.ClassNotFoundException: example.Hello
  </code></pre>
  
  <p>Hello.java</p>
  
  <pre><code>   package example;
  
     import java.rmi.Remote;
     import java.rmi.RemoteException;
  
     public interface Hello extends Remote
     {
          String sayHello() throws RemoteException;
     }
  </code></pre>
  
  <p>Server.java</p>
  
  <pre><code>    package example;
  
      import java.rmi.registry.Registry;
      import java.rmi.registry.LocateRegistry;
      import java.rmi.RemoteException;
      import java.rmi.server.UnicastRemoteObject;
  
       public class Server implements Hello
      {
  
             public Server() {}
  
             public String sayHello()
             {
             return "Hello, world!";
             }
  
  public static void main(String args[]) {
  
      try {
          Server obj = new Server();
          Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
  
          // Bind the remote object's stub in the registry
          Registry registry = LocateRegistry.getRegistry();
          registry.bind("Hello", stub);
  
          System.err.println("Server ready");
      } catch (Exception e) {
          System.err.println("Server exception: " + e.toString());
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Client.java</p>
  
  <pre><code>   package example;
  
     import java.rmi.registry.LocateRegistry;
     import java.rmi.registry.Registry;
  
     public class Client 
     {
  
          private Client() {}
  
         public static void main(String[] args) 
         {
  
              String host = (args.length &lt; 1) ? null : args[0];
              try {
                    Registry registry = LocateRegistry.getRegistry(host);
                    Hello stub = (Hello) registry.lookup("Hello");
                    String response = stub.sayHello();
                    System.out.println("response: " + response);
              } catch (Exception e) {
              System.err.println("Client exception: " + e.toString());
              e.printStackTrace();
              }
        }
     }
  </code></pre>
  
  <p>Are there any steps that I missed? What should I do?</p>