• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

2 RMIServers on the Same Machine

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic