Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI problem with Localhost

 
J You
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest workaround is to substitute 'localhost' with '127.0.0.1' -- should work just fine then.
That is, by the way, an ugly IP address you're being given. It's a network number (i.e., the address that identifies the network itself, not any one station) but if it's working then your ISP may be doing some hinky routing thing.
 
arun sahni
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J YOU
You are using dialup connection to acceess to internet. That's why you PPP adapter in ipconfig.
You can assign ip address to your ethernet card starting with 10.10.10.x like 10.10.10.1 these are addresses assigned for intranet working and will not create clash outside world. Once you assign address then you can assign name in your host file like :
10.10.10.1 your_host_name
Then you can accesshttp://your_host_name ort# from your browser or any other protocol. Do not forget to change netmask to 255.255.255.0 otherwise you will not get host#.
[ March 27, 2002: Message edited by: arun sahni ]
 
J You
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
After I assigned the 10.10.10.1 as the IP address
in the TCP/IP protocol property,all problems
disappeared.
I noticed the IP address was specified to
152.163.0.0.Still don't understand who originally set the static IP address,
the Computer manufactur,WinXP or the Dialup ISP?
Anyway,I am just very glad that the problems get
solved.
 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am also faced with the similar kind of problem.

Any solutions ??
Thanks
Ravi
 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the same problem, and after I assigned the IP address on my machine to 10.10.10.1 (just like J You above), it works fine for me too.
Thanks.
TJ
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic