Problem with LocateRegistry.createRegistry
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   yogesh_dhake
Posted On:   Wednesday, January 2, 2002 03:00 AM

I have a problem with the LocateRegistry.createRegistry(int port) method.
The registry starts of fine with no problem with the first passed port number but later if I try to start the registry again with another port number, I get the exception
"Exception in LocateRegistry.createRegistry : internal error: ObjID already in use"

Kindly let me know the solution

Re: Problem with LocateRegistry.createRegistry

Posted By:   Anonymous  
Posted On:   Sunday, January 6, 2002 10:35 AM

The problem is that there can be only one RMI registry created in a Vitrual Machine. (this is a limitation to the concept of RMI).




Since RMI needs to have a few objects with a known Object ID for allowing clients to find the Registry, these can not exist multiple times in the same VM.


(If you search the RMI-user archives at java.sun.com, you'll find a more detailed explanation).





What you can do is start one RMI registry from within your application with LocateRegistry.createRegistry, and start one or more other RMI registries externally (on the command prompt with 'rmiregistry').

About | Sitemap | Contact