I was having a problem with RMI running on Ubuntu PC (Ubuntu 9.04).
Whenever I tried to run my RMI program on Ubuntu PC, it showed the error,
java.rmi.ConnectException: Connection refused to host 127.0.1.1; nested exception is: java.net.ConnectException: Connection refused.
I have no idea why the host is here 127.0.1.1 ...
I tried out in many Ubuntu PC’s and everywhere it showed this error.
Found a solution to this problem:
I checked the /etc/hosts on Ubuntu machine and saw that 127.0.1.1 was mapped to ubuntu-PC name, so I've rewritten it to my correct LAN IP.
The /etc/hosts file in my PC looks like this
127.0.0.1 localhost
127.0.1.1 MYPCNAME
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Using the command vi /etc/hosts, I changed the 2nd line to
127.0.0.1 localhost
172.16.1.1 MYPCNAME
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
After that it worked fine!
No comments:
Post a Comment
Thanks for visiting my Blog....Ur comments n suggestions are most valuable for me...Thanks