This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes ConnectionException under Win ME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "ConnectionException under Win ME" Watch "ConnectionException under Win ME" New topic

ConnectionException under Win ME

Mike Southgate
Ranch Hand

Joined: Jul 18, 2003
Posts: 183
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:
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<br />SCJP, SCJD
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

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.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: ConnectionException under Win ME
It's not a secret anymore!