Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

2 RMIServers on the Same Machine  RSS feed

 
I Ritchie
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How do I run 2 RMI Servers on the same machine? They are bound to different locations i.e. /Service1 and /Service 2. The class files for each are ti be run from different locations however - I thought I could start two instances of rmiregistry, on in each location, but it wont let me!
Any ideas?
 
Vinod John
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by I Ritchie:

I thought I could start two instances of rmiregistry, on in each location, but it wont let me!

I am not sure what you are trying but in general, you can actually start two instance of RMIRegistry on different unused ports. But you can run only one rmiregistry per JVM (bcos rmiregistry uses a hard coded ObjID, whic is assigned to each remote object) and you will get a ExportException, this normally happens when you programatically start the registry using
LocateRegistry.createRegistry(port).
 
Chris De Vries
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have to start to registries, you can use one rmiregistry and bind the remote objects from the two separate JVMs to that registry using the Naming.rebind() or Naming.bind() methods.
Chris
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!