File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

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

Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146

My Tomcat is running fine and so is my application. The problem is that I am able to access it by giving: but on giving http://localhost:8080/appname (or even using 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?

Eric Labashosky

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: 17410

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: http://localhost:8080 not working,giving IP works fine!
jQuery in Action, 3rd edition