我正在实施一个银行系统,我想向ResultSet
客户发送一个。但是Java向我显示了一个错误。
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 ?
当我运行客户端时,我看到的错误是:
注册表查找有错误解组返回标头错误;嵌套异常是:java.io.EOFException