Tomcat cannot connect to localhost

During the service restart I get the following error:

org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop: Connection timed out

Seems that Tomcat cannot connect to localhost.

Indeed, when I execute

# telnet localhost
Trying xx.xx.xx.xx...
telnet: connect to address xx.xx.xx.xx: Connection timed out
telnet: Unable to connect to remote host: Connection timed out
xx.xx.xx.xx - some IP I use on the server, not the main one - and not!)

in /etc/hosts       localhost.localdomain  localhost

Any ideas will be appreciated.
Who is Participating?
n_sachin1Connect With a Mentor Commented:
When java attempts to resolve the localhost, it also attempts to get the hostname and connect to it to fetch the ip. If there is a conflict anywhere, you will get into these issues

1. try ipconfig (if you are on windows) to check if your ip is what you think it is.
2. try hostname and see if that returns your actual host name
3. try ping -a <your ip> and see if that resolves to your actual hostname

Basically, your network configuration has gone awry
Try if you can ping the host by that IP which you use
twolinesAuthor Commented:
ping localhost gives this IP address, xx.xx.xx.xx, but not
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Try to ping on that ip rather than by local host - the sa$me way tomcat wants to reach it
twolinesAuthor Commented:
this IP is also pingable
Do you think telnet to localhost worked before when tomcat was also operating?
twolinesAuthor Commented:
no idea, for being honest..
Is this a big server? Perhaps youi can try to reboot the system. This is probably somenetwork issue
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.