我在Java中使用rmi,但出现了"remote object implements illegal remote interface"的ExportException错误。
这是我的代码,请帮忙看看问题在哪里?
public interface RemotePeer extends Remote {
public abstract void displayInf(String inf);
public abstract void exit();
public abstract boolean isActive();
}
public class Peer implements RemotePeer{
public Peer(){}
....
public static void main(String[] args) {
Peer p=new Peer()
RemotePeer remoteP=(RemotePeer) UnicastRemoteObject.exportObject(p, 0);
Registry registry = LocateRegistry.getRegistry();
}
}