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:18

It occurs when others in the project are also using the same port numbers as you are using! double click tomcat server, change port numbers to anything 8585 or whatever. The code will now begin to run!

查看更多
残风、尘缘若梦
3楼-- · 2019-01-01 08:21

You've another instance of Tomcat already running. You can confirm this by going to http://localhost:8080 in your webbrowser and check if you get the Tomcat default home page or a Tomcat-specific 404 error page. Both are equally valid evidence that Tomcat runs fine; if it didn't, then you would have gotten a browser specific HTTP connection timeout error message.

You need to shutdown it. Go to /bin subfolder of the Tomcat installation folder and execute the shutdown.bat (Windows) or shutdown.sh (Unix) script. If in vain, close Eclipse and then open the task manager and kill all java and/or javaw processes.

Or if you actually installed it as a Windows service for some reason (this is namely intented for production and is unhelpful when you're just developing), open the services manager (Start > Run > services.msc) and stop the Tomcat service. If necessary, uninstall the Windows service altogether. For development, just the ZIP file is sufficient.

Or if your actual intent is to run two instances of Tomcat simultaneously, then you have to configure the second instance to listen on different ports. Consult the Tomcat documentation for more detail.

查看更多
心情的温度
4楼-- · 2019-01-01 08:22

In windows OS do right click on task bar-->start task manager-->process then check java.exe or javaw is running if it is running,then click on it and do end process then restart your tom cat server.

  1. some times skype will occupy port 80 in that case change the skype settings and put 81 for skype or change tomcat configuration.
查看更多
明月照影归
5楼-- · 2019-01-01 08:23
kill $(ps -aef | grep java | grep apache | awk '{print $2}')
  • no need to restart Eclipse
  • if you get the above error, just enter this line in terminal
  • again start the tomcat in Eclipse.
  • works only in Linux based system ( Ubuntu ..etc )
查看更多
裙下三千臣
6楼-- · 2019-01-01 08:23

For windows users:

Go to Task Manager directly with CTRL+SHIFT+ESC key combination.

Kill the "java.exe" processes by right clicking and selecting "End Task".

查看更多
不再属于我。
7楼-- · 2019-01-01 08:25

I checked all the answers but informing only to kill PID.

In case if you have terminal access shared by all it will not help or maybe you do not have permission to kill PID.

In this case what you can do is:

Double click on server

Go to Overview and change ports in Ports like this:

enter image description here

查看更多
登录 后发表回答