title: java.rmi.ServerException: RemoteException occurred in server thread; ClassNotFoundException
body: <p>When I run my Server code through eclipse, I got the following exception:</p>
  
  <pre><code>java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
      java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
      java.lang.ClassNotFoundException: com.RMIInterface
      at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:413)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
      at sun.rmi.transport.Transport$1.run(Transport.java:177)
  </code></pre>
  
  <p>I have started the RMI Registry by simply typing "start rmiregistry" in cmd line. A new window opened with the heading "c:\Program Files\Java\jdk1.7.0\bin\rmiregistry.exe". In this path only I have JDK.</p>
  
  <p>All my .class files available in this path : D:\Workspace\Study\bin\com.</p>
  
  <p>Under the com folder I have all three files "RMIInterface, RMIServer,RMIClient".</p>
  
  <p>When I run the Server code from eclipse, I got an above mentioned exception.(i.e.,) RMIInterface not found. But I have it in the same folder.</p>
  
  <p>What else should I do to run the server?</p>
  
  <p>This is my server code:</p>
  
  <pre><code>RMIServer serRef = new RMIServer();
  try {
      RMIInterface inref = (RMIInterface)UnicastRemoteObject.exportObject(serRef, 0);
      Registry reg = LocateRegistry.getRegistry();
      reg.bind("ServerObj", inref); --------&gt;Exception in this line
  } catch (AlreadyBoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      }
  </code></pre>