rmi problem; does it work for anyone?

Bryce McKinlay bryce@mckinlay.net.nz
Tue Aug 12 05:15:00 GMT 2003


On Tuesday, Aug 12, 2003, at 04:10 Pacific/Auckland, 
tlewis@mindspring.com wrote:
> Judging from the archives, I don't seem to be the only one with 
> problems
> using RMI under gcj.

> When I try to run the server, I get:
>> Trouble: java.rmi.RemoteException: connection failed to host: ; nested 
> exception is:
> java.net.UnknownHostException:
>> UnknownHost is kind of puzzling, since the naming call is:
>> Naming.rebind("rmi://127.0.0.1:1099/CalculatorService", c);

I took a quick look at java/rmi/Naming.java and saw an obvious problem. 
It is trying to parse the rmi: URI by sticking "http:" in front of it 
and parsing it as a url:
	URL u = new URL("http:" + name);
So basically, this code doesn't work. The solution is to implement the 
new java.net.URI class (currently its just a stub), and use that to 
parse the rmi: address.
Regards
Bryce.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /