[size=medium]no security manager: RMI classloader disabled
解决方法:
1)在rmi server提供了一个远程方法
void test(TheBaseObject o) throws RemoteException;
TheBaseObject 类就在rmi server的jar包中
2)在rmi client执行:
TheExtendedObject 继承自TheBaseObject,但是在另外一个jar包中,在rmi client的classpath内能找到此类。
执行后抛出异常:
于是改用
执行后正常。
3)定位:原因在于TheExtenedObject类不在rmi server的jar包或者classpath中,于是拷贝此类
到rmi server中,再次执行,OK
4)分析:在rmi client提交此类,由于要序列化后传递到RMI server,其需要反序列化得到实例,前提是能找到此类的定义,但是classpath又找不到,所以出现上述问题,经过拷贝解决 问题。[/size]
解决方法:
1)在rmi server提供了一个远程方法
void test(TheBaseObject o) throws RemoteException;
TheBaseObject 类就在rmi server的jar包中
2)在rmi client执行:
IRemoteServer rs = (IRemoteServer)Naming.lookup("xxxx");
TheBaseObject o = new TheExtendedObject();
rs.test(o)
[size=medium][/size]TheExtendedObject 继承自TheBaseObject,但是在另外一个jar包中,在rmi client的classpath内能找到此类。
执行后抛出异常:
classNotFound :TheExtendedObject no security manager: RMI classloader disabled
于是改用
TheBaseObject o = new TheBaseObject();
执行后正常。
3)定位:原因在于TheExtenedObject类不在rmi server的jar包或者classpath中,于是拷贝此类
到rmi server中,再次执行,OK
4)分析:在rmi client提交此类,由于要序列化后传递到RMI server,其需要反序列化得到实例,前提是能找到此类的定义,但是classpath又找不到,所以出现上述问题,经过拷贝解决 问题。[/size]