Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ConnectionException under Win ME

 
Mike Southgate
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My assignment works fine under Win XP and Win 2000. Under Win 98 and Win ME it gives an error. It was showing up as an IOException at first but that was only because RemoteException is a type of IOException. Turns out, it can create the registry OK by it can't register the server in it. I've copied my code below:
LocateRegistry.createRegistry(Integer.parseInt(port));
System.out.println("registry started:" + symbolicName);
Naming.rebind(symbolicName, this);
I see the message, but then I get a ConnectionException Connection Refused to host.
Can anyone tell me what I'm doing wrong?
ms
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does symbolicName have the port number in the String.
I found this in the API Documentation
Each method of the Naming class takes as one of its arguments a name that is a java.lang.String in URL format (without the scheme component) of the form:
//host ort/name

where host is the host (remote or local) where the registry is located, port is the port number on which the registry accepts calls, and where name is a simple string uninterpreted by the registry. Both host and port are optional. If host is omitted, the host defaults to the local host. If port is omitted, then the port defaults to 1099, the "well-known" port that RMI's registry, rmiregistry, uses.

Most importantly this part.

If port is omitted, then the port defaults to 1099, the "well-known" port that RMI's registry, rmiregistry, uses.

That's my guess.
btw, I used the default port 1099.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic