Several ports (8005, 8080, 8009) required by Tomca

2019-01-01 07:41发布

I'm getting the following error when I try to run a simple JSP program on Tomcat in Eclipse.

Several ports (8005, 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).

How is this caused and how can I solve it?

30条回答
君临天下
2楼-- · 2019-01-01 08:34

If you are running on windows try this in the command line prompt:

netstat -ano

This will show all ports in use and the process id PID # of the process that is using that port. Then Ctrl+Alt+Del and open Task Manager to see which process is that.

You can then choose either to close/stop it or configure your server to use another port. To check if the new choosen port (let's say 8010) is available do this:

netstat -ano | grep 8010

If it does not return any lines then you are fine.

To change the port go to the Server view, open server.xml and change the port there. Mine has this entry:

Connector port="8010" protocol="AJP/1.3" redirectPort="8443"
查看更多
谁念西风独自凉
3楼-- · 2019-01-01 08:37

I have no another instance of Tomcat running ad no other process using "Tomcat port" (in my case, the 8088 port). Eclipse send the same message on starting Tomcat:

....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).

I solve the problem in this way:

  • go to bin of tomcat by prompt
  • launch startup.bat
  • launch shutdown.bat
  • start tomcat by Eclipse
查看更多
长期被迫恋爱
4楼-- · 2019-01-01 08:38

If you use Eclipse then double click on servers and double click on tomcat server then one file will open. In that file change HTTP port to some other port number and save(Ctrl+S) then again start the server.

查看更多
若你有天会懂
5楼-- · 2019-01-01 08:38

Step 1: netstat -a -o -n and it will bring up a network list,search for the local address like 127.0.0.1:8080 and note the PID (eq 3624)

C:\>netstat -a -o -n

Step2 : taskkill /F /PID 3624 . Run this command to kill that process.

C:\>taskkill /F /PID 3624

link to post

查看更多
情到深处是孤独
6楼-- · 2019-01-01 08:38

Your Tomcat is probably running already. That's why you have got an error. I've had the same problem before. I solved it very simply:

  1. Restart your computer
  2. Open Eclipse
  3. Run your Tomcat

That's all.

查看更多
泛滥B
7楼-- · 2019-01-01 08:39

The simpler fix that works for me is deleting my current deployed webapps from tomcat through the "Server" tab. Once I remove them the problem goes away. Simply re-deploy your project by going on Run As > Run on Server.

查看更多
登录 后发表回答