做ejb3.0的Demo的时候出现的一个反常错误,错误提示如下:
javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: ejb.facade.IFacade (no security manager: RMI class loader disabled)]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:786)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(Unknown Source)
at make.Test.main(Test.java:29)
Caused by: java.lang.ClassNotFoundException: ejb.facade.IFacade (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.rmi.MarshalledObject.get(Unknown Source)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:710)
... 3 more
这个错误郁闷了我很久原来是 我从服务器拷贝出来的接口和实体类到客户端的时候他们在客户端的包名与服务端所在的包名不一致是造成的, 服务端与客户端jar必须完全一致。否则造成客户端访问时,客户端须先从服务端下载,报安全许可异常。记下这个错误防止以后在做错了