Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

http://localhost:8080 not working,giving IP works fine!

 
Abhishek Asthana
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

My Tomcat is running fine and so is my application. The problem is that I am able to access it by giving: http://10.xxx.xxx.xxx:8080/appname but on giving http://localhost:8080/appname (or even using 127.0.0.1) I am getting following error:
500 Server Error
The following error occurred:

[code=CANT_CONNECT_LOOPBACK] Cannot connect due to potential loopback problems
Please contact the administrator.

Any clues, what might have broken?

Thanks
 
Eric Labashosky
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a similar problem; the bowser could access localhost:8080 but ant tasks and some java web service clients couldn't

I'm running Win7 and had installed wireshark earlier in the day but never rebooted.

I disabled IPv6 on my system and rebooted and it started working.

LATER: i re-enabled IPv6 and it was still working??? So i have to assume my problem was the rebooted. (Thanks nothing win7)
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most likely the entry for "localhost" in the hosts file (/etc/hosts for Linux/Unix/Solaris) is defective. Windows has a hosts file, too, but I'm not sure if it uses it to get localhost.

I think Eric has a different problem. Java apps that want the server's IP address (assuming it only has one) can't get it from reverse lookups on "localhost", so sometimes the apps have to be explictly configured.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic