?
Solved

Tomcat cannot connect to localhost

Posted on 2011-09-08
8
Medium Priority
?
727 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36507092
Try if you can ping the host by that IP which you use
0
 

Author Comment

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

Expert Comment

by:for_yan
ID: 36507170
Try to ping on that ip rather than by local host - the sa$me way tomcat wants to reach it
0
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 

Author Comment

by:twolines
ID: 36507217
this IP is also pingable
0
 
LVL 47

Expert Comment

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

Author Comment

by:twolines
ID: 36507289
no idea, for being honest..
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36507342
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 2000 total points
ID: 36508703
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

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month11 days, 6 hours left to enroll

752 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