Hi!

In JSWDK 1.0 I'm trying to get hold of the RMIRegistry and binding an
object to it by doing this:

 try {
  // get existent registry
  myRegistry = LocateRegistry.getRegistry("localhost", 1099);
  // check if this works...
  myRegistry.list(); // (1)
 }
 catch(Exception e) {
  e.printStacktrace();
  myRegistry = null;
 }
 if (myRegistry == null) {
  // didn't work, so create new registry
  myRegistry = LocateRegistry.createRegistry(1099); // (2)
 }
 // bind myObject
 myRegistry.rebind("myIdentifier", myObject);

Now my problem is that (1) fails with a java.net.ConnectException:
Connection refused and (2) fails with java.rmi.server.ExportException:
internal error: ObjID already in use.
So can't use the existing Registry and can't create a new one at the
same time :-(
I tries to create a new Registry listening to a different port, but that
failed, too.

If I start rmiregistry from the commandline before starting JSWDK it
works smoothly, but I have the overhead of running a second JVM.

Does anybody know what's going on here?

TIA

hendrik

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to