|
hello everybody:
At the first time,I'm
troubled with the RMISecurityManager problem.
I hava finished the Remote interface,
implemention class and made the stub/skeleton used the following
command line:
start rmiregistry
1099 (Ok)
rmic -vcompat com.sabirna.rmi.Customer (ok)
java
-Djava.security.policy=my.policy com.sabirna.rmi.Customer
But when executing the last command line,the
following error msg appears in console.
(Note that in the com.sabrina.rmi.Customer
source code have one statement "System.setSecurityManager(new
RMISecurityManager()); ")
Pls help me.Any help of you would be
appreciated.
Best Regards.
Ketty
----------------------my.policy detail-----------------------------
grant {
permission java.security.AllPermission;
};
-----------------------the
directory tree------------------------
MyFold
|____my.policy
|
|____com.sabrina.rmi
|--CustomerInterface
(remote interface)
|--Customer (implemetation
class)
|--Customer_Stub and
Customer_Skel
--------------------------Following is error msg-------------------
java.security.AccessControlException: access
denied (java.net.SocketPermission 1
92.168.0.3:1099 connect,resolve) at java.security.AccessControlContext.checkPermission(AccessControlConte xt.java:270) at java.security.AccessController.checkPermission(AccessController.java: 401) at java.lang.SecurityManager.checkPermission(SecurityManager.java:542) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044) at java.net.Socket.connect(Socket.java:419) at java.net.Socket.connect(Socket.java:375) at java.net.Socket.<init>(Socket.java:290) at java.net.Socket.<init>(Socket.java:118) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect SocketFactory.java:22) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster SocketFactory.java:122) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185 ) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171) at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313) at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source) at java.rmi.Naming.rebind(Naming.java:159) at com.sabrina.rmi.Customer.main(Customer.java:25) |
