Hi,I am
testing an RMI application with my home
computer.This application is the Calculator example
from tutorial at Sun
Java site.In the server program,
the code is like following
Calculator c = new CalculatorImpl();
Naming.rebind("rmi://localhost:1099/CalculatorService", c);
But when I run the client program,it got the
ConnectException:
java.rmi.ConnectException: connect refused to host: 152.163.0.0;Nested Exception is
java.net.ConnectException: Operation Timed out : connection
I think the problem is the TCP/IP configuration of
my home computer.This is a brand new computer and
I use dial connection to access Internet.It seems
in the RMI,it resolves the localhost to "152.163.0.0"(the ISP ip address?),which then
refues the connection.
If I ping localhost,I can get 127.0.0.1
when I ping the computer name,I get the 152.163.0.0
I also installed the
Tomcat in the computer,and I
can access
http://localhost:8080 (but the shutdown.bat fails,and I guess the reason is also
the localhost stuff)
following is the output of "ipconfig -all" command:
Windows IP Configuration
Host Name . . . . . . . . . . . . : MAYOU
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : WAN Network Driver
Physical Address. . . . . . . . . : 00-03-8A-00-00-11
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 152.163.0.0
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . :
PPP adapter Prodigy (San Antonio):
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : WAN (PPP/SLIP) Interface
Physical Address. . . . . . . . . : 00-53-45-00-00-00
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 66.140.232.3
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 66.140.232.3
DNS Servers . . . . . . . . . . . : 198.83.19.241 198.83.19.244
Also,I checked the file /Windows/System32/etc/hosts and it does have
127.0.0.1 localhost