Solved

Tomcat cannot connect to localhost

Posted on 2011-09-08
8
706 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:twolines
  • 4
  • 3
8 Comments
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Try if you can ping the host by that IP which you use
0
 

Author Comment

by:twolines
Comment Utility
ping localhost gives this IP address, xx.xx.xx.xx, but not 127.0.0.1
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Try to ping on that ip rather than by local host - the sa$me way tomcat wants to reach it
0
 

Author Comment

by:twolines
Comment Utility
this IP is also pingable
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Do you think telnet to localhost worked before when tomcat was also operating?
0
 

Author Comment

by:twolines
Comment Utility
no idea, for being honest..
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Is this a big server? Perhaps youi can try to reboot the system. This is probably somenetwork issue
0
 
LVL 8

Accepted Solution

by:
n_sachin1 earned 500 total points
Comment Utility
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
IT Company 5 67
changeXy challenge 13 56
word0 challenge 3 55
Help needed with BIND9 DNS on Ubuntu. 22 65
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now