【现象】
启动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”
【官方解释】
make sure you throw RemoteException in all methods that you expose.
http://www.coderanch.com/t/189384/Developer-Certification-SCJD/certification/RMI-client-failure
http://bach.yo2.cn/articles/%E8%AF%95%E7%94%A8rmi-plugin-for-eclipse.html
启动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”
【官方解释】
make sure you throw RemoteException in all methods that you expose.
http://www.coderanch.com/t/189384/Developer-Certification-SCJD/certification/RMI-client-failure
http://bach.yo2.cn/articles/%E8%AF%95%E7%94%A8rmi-plugin-for-eclipse.html