今天运行tomcat时忽然报一下错误信息:
Several ports (8005, 8080, 8009) required by Tomcat v8.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).
这种情况可能是因为打开的tomcat服务未关闭。点击下载的tomcat文件夹下的bin文件夹下的shutdown.bat关闭tomcat服务。如果还是报相同错误,说明相关端口被其它进程占用了。
找到一下两种解决方法:
解决方法一:改变tomcat服务器所使用的端口号(不推荐,因为发现改变的端口号也可能会被使用):
- 双击Servers栏下的服务器,打开服务器设置
ps:找不到servers栏就点击工具栏下 Window---Show View---Servers
- 在图中标识的位置改变所用端口号,一般把每个端口号加一即可
解决方法二:down掉正在使用8005,8080,8009的进程
第一步 Windows+R cmd 命令窗口
输入 netstat -ano|findstr 8080netstat -ano|findstr 8005
netstat -ano|findstr 8009
//说明:查看占用8080,8005,8009端口的进程
显示占用端口的进程x
第二步 taskkill /pid x /f