今天在idea中debug多个应用时报错:
Description:
Web server failed to start. Port 8081 was already in use.
Action:
Identify and stop the process that’s listening on port 8081 or configure this application to listen on another port.
以为是tomcat使用的http端口冲突,检查 server.port 后发现不是这个问题。
最终定位到是因为打开了tomcat的ManagementServer,它默认的端口使用的就是8081;
ManagementServer 配置
解决方法:
将端口号改为其他,每个应用不同即可。
management:
server:
port: 8181