【现象】
启动RMI的Server端程序,报如下错误:
Caused by: java.lang.IllegalArgumentException: illegal remote method encountered: ...
at sun.rmi.server.Util.checkMethod(Util.java:244)
at sun.rmi.server.Util.getRemoteInterfaces(Util.java:223)
at sun.rmi.server.Util.getRemoteInterfaces(Util.java:193)
at sun.rmi.server.Util.createProxy(Util.java:126)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:179)
... 70 more
【解决】
RMI中的方法需要添加 “throws RemoteException”
启动RMI的Server端程序,报如下错误:
Caused by: java.lang.IllegalArgumentException: illegal remote method encountered: ...
at sun.rmi.server.Util.checkMethod(Util.java:244)
at sun.rmi.server.Util.getRemoteInterfaces(Util.java:223)
at sun.rmi.server.Util.getRemoteInterfaces(Util.java:193)
at sun.rmi.server.Util.createProxy(Util.java:126)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:179)
... 70 more
【解决】
RMI中的方法需要添加 “throws RemoteException”