Get your CodeRanch badge!*
The moose likes Distributed Java and the fly likes starting rmid Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "starting rmid" Watch "starting rmid" New topic
Author

starting rmid

Doug Melzer
Ranch Hand

Joined: Mar 23, 2000
Posts: 51
One can programatically start an rmiregistry using LocateRegistry.createRegistry
Is there an analagous way to start rmid?
David Duran
Ranch Hand

Joined: Feb 11, 2002
Posts: 122
Digging this one from the grave...
I'm looking for the same answer. Is it possible to start rmid from within a Java program?
I tried the below line of code but I'd still get exceptions telling me that the Activation System isn't running:
Process p = Runtime.getRuntime().exec("rmid -J-Djava.security.policy=" + System.getProperty("user.dir") + System.getProperty("file.separator") + "policy.file");
I use user.dir and file.separator to determine the location of the policy file (the same location that the Java program is being executed).
[ June 10, 2002: Message edited by: David Duran ]
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

The start time for the rmid process isn't trivial, in my experience. I'd follow the exec() call with a sleep of 5-10 seconds, then look to see if the process is running.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
David Duran
Ranch Hand

Joined: Feb 11, 2002
Posts: 122
Hahaha, jeez louise. No wonder it wasn't working. I already did have a call to Thread.sleep()after it but it didn't seem to work...
Thread.sleep(3);
It slipped my mind that that's not 3 seconds... but 3 ms. Thanks Michael.
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Soemtimes it's scary, being this good. :roll:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: starting rmid
 
Similar Threads
RMI registry - inside or out?
RMI Activation tutorial example does not work for me
security policy for rmid?
JINI 1.2 : REGGIE
RMID, RMIRegistry and ports