File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating more than a single RMI registry in the same VM is failing ?

 
kri shan
Ranch Hand
Posts: 1453
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An attempt to create more than a single registry in the
same VM isl failing.

createRegistry(portNumber) ;

getting
java.rmi.server.ExportException: internal error:
ObjID already in use

java version is 1.6.0_26
 
Kathleen Angeles
Ranch Hand
Posts: 123
Firefox Browser Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need more than 1, they should listen to different ports.
 
kri shan
Ranch Hand
Posts: 1453
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to stop the existing running RMI registry and re-start the RMI registry with same port number ?
 
Kathleen Angeles
Ranch Hand
Posts: 123
Firefox Browser Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can refer to official Java RMI API. That would most likely be just one-liner commands.
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only one RMI Registry is permitted per machine. There is no programmable way to kill the Registry.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quote:

If you need more than 1, they should must listen to different ports.

(only one application can hold a specific listening port at a time. This is an OS/network limitation).

Quote:

Only one RMI Registry is permitted per machine. There is no programmable way to kill the Registry.

(Sure there is. If they're in separate JVMs, just terminate the offending JVM).
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK I stand corrected. I never tried to use multiple Registries on different ports.
 
Paul Clapham
Sheriff
Pie
Posts: 20206
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have multiple RMI registries running in production on a single computer here at work. Naturally they all run in separate JVMs and they all listen at different ports. And yes, we can terminate any of them at any time by killing the JVM in which they are running.

(... posted for people who weren't already entirely clear on how RMI registries work.)
 
kri shan
Ranch Hand
Posts: 1453
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we can terminate any of them at any time by killing the JVM in which they are running.


So only way to stop/kill the RMI registry is exit/killing the JVM. We are running bunch of TestNG test cases on the same JVM using same port. If i use different ports for different tests, i do not see any problem in the same JVM. Is there a way to stop the RMI registry programatically ?
 
Tony Docherty
Bartender
Pie
Posts: 2878
59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have started the registry programmatically using:

then I believe you can stop it programmatically using:

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic