启动Tomcat服务器报错: Several ports (8005, 8080, 8009) required by Tomcat v5.5 Server at localhost are alr
程序员文章站
2022-05-24 10:17:48
...
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:
启动Tomcat服务器报错:
Several ports (8005, 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(s).
原因:端口8005, 8080, 8009被占用了。可能是在打开Tomcat的情况下关闭了Eclipse,或是Eclipse非正常关闭,导致先前的Tomcat没有被关闭,端口占用。或是其他软件占用了tomcat的端口号。
方法1:杀掉占用端口的软件
打开任务管理器,找到java虚拟机相关的进程javaw.exe,将它结束掉.
方法2:修改tomcat默认端口号
修改Tomcat的配置文件
找到tomcat安装路径,C:\XX\apache-tomcat-8.5.9\conf文件夹下的server.xml或者打开eclipse工作空间下的Servers/server.xml文件修改端口号。
例如将
< Server port="8005" shutdown="SHUTDOWN" >
改为
< Server port="8015" shutdown="SHUTDOWN" >
- 1
- 2
- 3
<Connector URIEncoding="UTF-8" connectionTimeout="20000" port="8080" protocol="HTTP/1.1"
redirectPort="8443"/>
改为
<Connector URIEncoding="UTF-8" connectionTimeout="20000" port="8088" protocol="HTTP/1.1"
redirectPort="8443"/>
- 1
- 2
- 3
- 4
- 5
总之是将配置文件中端口号为8005,8080,8009的端口改为一个没有被占用的端口,重启服务器即可。