posted 19 years ago
This is probably a simple problem. I have many clients instianting remote objects i.e One client for one remote object BUT if the first client gets one remote object after creating the registry but when the second client tries to get a second remote object I run into a problem: my method looks like this:
Registry registry = LocateRegistry.getRegistry(host, port);
if (registry == null) {
LocateRegistry.createRegistry(port);
}
//Remote Object
RemoteServicesImp remoteServicesObject = new RemoteServicesImp();
Naming.rebind("RemoteServices", remoteServicesObject);
return (IRemoteServices) Naming.lookup("rmi://" + host + ":" + port + "/RemoteServices");
The registry should only be created once which it does when the first client instianties the remote object BUT the second client throws a ConnectRefusedException---why? -- The regisrty has already been created