Tomcat cannot connect to localhost

During the service restart I get the following error:

org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: 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 127.0.0.1(!)

in /etc/hosts
127.0.0.1       localhost.localdomain  localhost

Any ideas will be appreciated.
twolinesAsked:
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
0
 
for_yanCommented:
Try if you can ping the host by that IP which you use
0
 
twolinesAuthor Commented:
ping localhost gives this IP address, xx.xx.xx.xx, but not 127.0.0.1
0
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.

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