wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes Web project in eclipse doesn't find tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Web project in eclipse doesn Watch "Web project in eclipse doesn New topic

Web project in eclipse doesn't find tomcat

moshi cochem
Ranch Hand

Joined: Nov 10, 2009
Posts: 91
Hi, I created a new web project using eclipse. I put in it a simple html file, and tried to run it.
I selected the "run on server" option.
I was asked to choose the web server I want to use.
I was asked to choose: "tomcat server v6.0 at local host" - "STOPPED",
or to "manually define a new server".
Because my tomcat in signed as "stopped" (I don't know how, since it is running),
I chose the second choice: "manually define...", and "defined" my server, by choosing
manually from the list: tomcat 6.
I got an error of:

Several ports (8080, 8009) required by Tomcat v6.0 Server at localhost
are already in use. The server may already be running in another process,
or a system process may be using the port. To start this server you will need
to stop the other process or change the port number(s).

my tomcat is running on : localhost:8080
port 8009 in avalable. I know it since I did: netstat -an , and saw that 8009 is listening.

What should I do?
Thanks a lot for any help.
David Newton

Joined: Sep 29, 2008
Posts: 12617

Shut it down before trying to restart it.
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
Eclipse will want to start its own instance of the server. If you have the server running stand-alone (outside of Eclipse) these won't mix well.
moshi cochem
Ranch Hand

Joined: Nov 10, 2009
Posts: 91
Thanks for your reply.
I stopped the tomcat, so 8080 is now available,
and I succeeded running a web app inside eclipse.
But what is this internal tomcat ? I don't have to have
my tomcat thow. Am I right ?
It is actually saving me the export war file, doesn't it ?
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
I'm glad to hear that you got it working.

Tomcat is an application server. You can start it yourself, using the scripts provided by the software, or you can have Eclipse start it for you. In either case, you're starting the same server (unless you've taken steps to start different servers in each case, which I don't know if Tomcat supports - as I don't use Tomcat).

Eclipse is using the version of Tomcat that you installed on your machine. If you recall, when you created your web application and indicated the runtime environment would be Tomcat, you had to tell Eclipse where you installed it.

Running the application from within Eclipse can be very handy for development and debugging, but you wouldn't want your production application to run that way. Some application servers allow you to deploy an application in exploded format (not in a .War file) - I don't know if they all do this. I would think that by the time you're ready to deploy your application to your production environment, you're going to want to create a .War file to deploy.

Please let me know if I missed anything.
moshi cochem
Ranch Hand

Joined: Nov 10, 2009
Posts: 91
Hi Mark,
Thanks a lot for your explanation!
I agree. Here's the link: http://aspose.com/file-tools
subject: Web project in eclipse doesn't find tomcat
Similar Threads
starting Tomcat V5.5 server at localhost
Unable to launch Tomcat from eclipse.
Issues with Starting Tomcat server in Ecllipse
eclipse IDE showing error
Unable to start Tomcat v6.0 server