title: Sending and receiving an Object from an RMI Server and Client using seralization
body: <p>I was implementing a banking system and I want to send a <code>ResultSet</code> to the client.  But Java shows me an error.</p>
  
  <pre><code>    public interface SekelatonInterface extends Remote {
  
      public String test() throws RemoteException; // this is ok it works fine
  
      public ConnectionClass getConnection() throws RemoteException; //shows error on     client call
  
       public ResultSet getAllDeposits(Integer CustomerId) throws RemoteException;
    }
  
    public class SekelatonImpl extends UnicastRemoteObject implements SekelationInterface {
  
  
  
     SekelatonImpl() throws RemoteException{
  
     }
  
                //sekelaton implemeation
      public ConnectionClass getConnection() {
  
      try {
       dbobject = new ConnectionClass();
        dbobject.connectDb();
       dbObject.setQuery("select * from cutomer"); 
        return dbobject; //this method is on connection class ,dont be confuse
  
       }
  
       catch(Exception ex)
  
             {
  
          System.out.println("Error :"+ex.getMessage());
             }
  
      }
  
    }
  
     public class Server {
  
  
     public  void PackServerandRun(String SecurityFilePath,Integer port,String rmiUrl) {
  
  
     //do rmi registery stuff and run server
      SekelatonImpl  databaseObject = new SekelationImpl(); // rebind this object
  
      }
  
  }
      cleintstub.test(); //this recive the server message or works fine
      cleintStub.getConnection(); //why couldn't i get a ConnectionClass Object ?
  </code></pre>
  
  <p>When I run client the error I'm seeing is: </p>
  
  <blockquote>
    <p>Registry Look Up has error Error unmarshaling return header; nested exception is: java.io.EOFException</p>
  </blockquote>