3
votes

I use eclipse for java EE as my IDE and tomcat as my server. Here's the problem:

Several ports (8080, 8009) required by Tomcat v5.5 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.

5

5 Answers

2
votes

It is as the exception says - you have a running instance of Tomcat (or, less likely, something else), that's taking ports 8080 and/or 8009. What to do:

  • if you've started tomcat, find it and stop it: using /etc/init.d/tomcat stop, or administrative tools > services > apache tomcat > stop, or shutdown.sh / shutdown.bat
  • if it is not you, find the process of tomcat and kill it (task manager on windows, and something like ps ux on nix)
  • if you don't find it, reboot
1
votes

It looks like you have a Tomcat running already. It is possible that Eclipse couldn't stop Tomcat and now that it tries to run it again, it can't. Find and kill the existing process or reboot.

1
votes

Issue the tasklist command in command prompt. It should display tomcat as one of the processes. You can kill it by issuing either taskkill /IM "image_name" or taskkill /PID "process_id"

1
votes

Others have mentioned that you could try and track down what's using those ports (perhaps another instance of Tomcat?), and kill it. However it might be that Windows itself is using them.

Killing the rogue program, or rebooting, might cure the problem for now, but to prevent this happening again, you need to reserve the ports you need. KB812873 explains how to do this.

Disclaimer: This KB article is for Windows Server 2003 and Windows 2000, and it's a while since I had to do this (for a few Windows Server 2003 installations). However I imagine it's the same for Windows 7. If not, someone will correct me :-)

0
votes

Several ports (8080, 8009) required by Tomcat v5.5 Server at localhost are already in use.

You are not required to run Tomcat on 8080 or 8009. I am using Eclipse 8.6. I have set my Tomcat port to 8086 for eg. Here are the steps to do it:

  1. Stop Tomcat.

  2. Click on the Run/Stop/Restart dropdown button

  3. Select MyEclipse Tomcat

  4. Click Configure Connector

  5. Change port to whichever one you think is free.

To make sure you see these options make sure you have the latest version of MyEclipse.