• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 123
Firefox Browser Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you need more than 1, they should listen to different ports.
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can refer to official Java RMI API. That would most likely be just one-liner commands.
 
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only one RMI Registry is permitted per machine. There is no programmable way to kill the Registry.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK I stand corrected. I never tried to use multiple Registries on different ports.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have started the registry programmatically using:

then I believe you can stop it programmatically using:

 
Get me the mayor's office! I need to tell her about this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic