• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to create a central RMIRegistry server  RSS feed

 
Sven Anderson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm working on a java project where we are exposing RMI (using Spring) services externally as well as communicating with another internal system (within the same network) over RMI. Both systems are running on two independent Tomcat instances and managing their own registration of RMI services. Is it possible to have a central RMIRegistry server where these services can be registered?

Thanks
S
 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could have a third RMI server that points to the other two. :-)

This is actually a serious problem that has been around far longer than Java or RMI. Corba tried, and IMHO failed, to address it.

If a service is out somewhere in the cloud, how to you find where it is so you can talk to it and use it?
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One limitation of RMI registry is that you can not bind objects from a different machine than where the RMI registry is running.
So, if you are thinking of having a Registry that is on a different machine than atleast one of tomcat machines, then this is not possible.

This old post has some discussion and *possible* but not very elegant workarounds.
 
Sven Anderson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response. The discussion came up recently about this since we will in the near future have new projects and other systems to plug in to which will be talking RMI. But after all maybe it's not that "bad" having each project managing its own registry and as you say if it's not practically possible we have to stick to it.

If I have a number of projects deployed on one Tomcat instance (clustered server env). Would it be worth deploying a separate component only dealing with Registration of RMI services for the projects running on the same server? Are there actually any advantages in doing this (if it's possible). After all we don't want to make things more complicated than they are.

Thanks
A
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sven:
If I have a number of projects deployed on one Tomcat instance (clustered server env). Would it be worth deploying a separate component only dealing with Registration of RMI services for the projects running on the same server? Are there actually any advantages in doing this (if it's possible). After all we don't want to make things more complicated than they are.


Actually, If you intend to write a thin wrapper around RMI Registry that has the information of the registry port and can locate/start registry on that port, so that all clients do not need to know the registry port being used, then that makes sense.
Otherwise, there is not much in the registration of RMI server objects that one needs to do.
[ May 18, 2008: Message edited by: Nitesh Kant ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!