I have a client-server setup. The client must be able to bind certain objects to the RMIRegistry. Here is the server side code:
if (System.getSecurityManager() == null)
System.setSecurityManager(new RMISecurityManager());
System.setProperty("java.rmi.server.hostname", "192.168.0.99");
registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
registry.rebind(getRegistryNameImpl(), this);
It binds itself to the registry because I want to use client side RMI calls to bind new objects to the registry.
When I call the rebind methods on the client I get this exception:
java.rmi.ServerException: RemoteException occured in server thread; nested exception is:
java.rmi.AccessException: Registry.Registry.rebind disallowed; origin /130.126.127.94 is non-local host
How do I avoid t his AccessException?