aspose file tools*
The moose likes Tomcat and the fly likes http://localhost:8080 not working,giving IP works fine! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "http://localhost:8080 not working,giving IP works fine!" Watch "http://localhost:8080 not working,giving IP works fine!" New topic
Author

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

Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146
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

Joined: Sep 25, 2009
Posts: 1
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

Joined: Jun 25, 2001
Posts: 16019
    
  20

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: http://localhost:8080 not working,giving IP works fine!