how access control exception is removed
Pls suggest me how to overcome with this problem .
I have only this simple code=============>>
public MyRemoteServer() {
try {
MyRemote c = new MyRemoteImpl();
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
Registry r=LocateRegistry.createRegistry(1099);
Naming.rebind("rmi://192.168.0.60:1099/CalculatorService", c);
System.out.println("Server is now running ,waiting for client's stimlus");
} catch (Exception e) {
System.out.println("Trouble: " + e);
e.printStackTrace();
}
}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
and i got the following exception :============>>
java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.0.60:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)Trouble: java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.0.60:1099 connect,resolve)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1026)
at java.net.Socket.connect(Socket.java:446)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:124)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
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:160)
at com.myrmi.server.MyRemoteServer.<init>(MyRemoteServer.java:22)
at com.myrmi.server.MyRemoteServer.main(MyRemoteServer.java:32)
what things sud i do.
how to set code base ?
pls help

