Meaningless Drivel is fun!*
The moose likes Tomcat and the fly likes http://localhost:8080 not working but is working 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 but is working" Watch "http://localhost:8080 not working but is working" New topic

http://localhost:8080 not working but is working

Panduranga H G

Joined: Apr 28, 2008
Posts: 14
Hi Ranchers,

I ma working in windows, I am getting this error with tomcat can any one help me Please.

http://localhost:8080 not working but is working
Anirvan Majumdar
Ranch Hand

Joined: Feb 22, 2005
Posts: 261
Is working?
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

please verify below:

1.what is the tomcat port number?

2. are you using mozilla browser?
Jair Rillo Junior
Ranch Hand

Joined: Aug 27, 2008
Posts: 114
Chec it out the port number.

localhost:8080 is different than (the second address has not the port number, hence, by default it uses port 80). Try out also: http://localhost

Regards, Jair Rillo Junior, SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 5.0, IBM SOA Associate (Test 664).
netto gaurav

Joined: Jan 29, 2008
Posts: 7
Jair Rillo Junior wrote:Chec it out the port number.

localhost:8080 is different than (the second address has not the port number, hence, by default it uses port 80). Try out also: http://localhost

I'm facing the same problem in my case neither http://localhost nor http://locahost:8080/ nor work but the moment I do i'm able to see the docs, examples pages from the webapps folder.
I have tomcat 7 on windows 7. Earlier it was working now everything has stopped working...does any body have a clue?
my server.xml(snippet) is as below -

<Service name="Catalina">

<Connector port="8080" protocol="HTTP/1.1"
redirectPort="8443" />

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

<Engine name="Catalina" defaultHost="localhost">

<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">

Also, i'm not getting any error in the logs...Please let em know if anybody has an idea as to what could be causing this wierd behaviour...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15956

A few helpful hints on JavaRanch etiquette: We prefer that you would start a new message thread instead of reviving one that hasn't been used in several years. It's less confusing.

Also, there's a "Code" button on the message editor. You can use it to generate tags to wrap code, XML, and other pre-formatted text and make it easier to read.

To understand your problem, you have to understand URLs and hostname resolution. Every web request has to be sent to a TCP/IP port that's listening for data in the format that the client is using. For HTTP requests, by default, that's port 80 and for HTTPS requests, it's port 443.

Tomcat isn't normally set up to use port 80, since port numbers less than 4096 are privileged and require Tomcat to be privileged as well in order to use them and that's a security risk. When a URL is parsed and used to target a webserver, the port selection is not available from the hostname resolution mechanism - it ONLY resolves host addresses. So if you don't want the default port (80), you have to explicitly provide a port ID (8080).

That's part of your problem. The second part has to do with hostname resolution. TCP/IP systems support a number of different ways to convert a domain name such as "" to the IP address that gets the request; it's a very flexible system. One of the more popular ways involves 2 primary resolvers: DNS services and a hostnames file.

DNS services refers to a resolver that queries one or more Domain Name Servers which have been defined for the local machine's network configuration. The machine sends out a query to the DNS server on UDP port 53 and gets back a response consisting of the corresponding IP address.

Certain domains, however, are best served by a more immediate mechanism. An example are the critical hosts that a machine may need services from even when the DNS system is down. However, and even more important one is the hostname "localhost" and its related fully-qualified domain name "localhost.localdomain". These hostnames are almost always expected to resolve to, so they are hard-coded into a local hostnames file. This file is usually named "hostnames" or "HOSTS", but Windows has been known to use LMHOSTS. So when you cannot get "localhost" to resolve to, you need to find out the name and location of your local system's host names file and check it.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: http://localhost:8080 not working but is working
Similar Threads
Problem installing Tomcat 5.5 on Windows XP
Is localhost always = ?
Server was disconnected
The requested URL could not be retrieved : connection failed (111) connection refuse
starting problem of tomcat