在我们写RMI程序时,会遇到
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: client.Pi
原因:java1.7以来,useCodebaseOnly被默认设置为true
解决: -Djava.rmi.server.useCodebaseOnly=false, 当启动server和client时,都加上此项
参考:http://stackoverflow.com/questions/11273353/java-rmi-and-classnotfoundexception