File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

starting rmid

 
Doug Melzer
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One can programatically start an rmiregistry using LocateRegistry.createRegistry
Is there an analagous way to start rmid?
 
David Duran
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7292
Netbeans IDE VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Duran
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7292
Netbeans IDE VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Soemtimes it's scary, being this good. :roll:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic