问题描述:
错误消息:
一个服务以多端口启动,报错内容如下:
2021-11-22 09:32:35.253 ERROR 17604 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
// 端口被 40000 占用,发现修改后的端口没有启用
Web server failed to start. Port 40000 was already in use.
Action:
Identify and stop the process that's listening on port 40000 or configure this application to listen on another port.
原因分析:
修改后的端口没有启用,我的操作如下过程:
- 右键,选中
copy configuration
- 多端口启动两种方式(任选一种)
// 方式一
VM options: -Dserver.port=40001
// 方式二
Program arguments: --server.port=40001
启动后
解决方案:
原因: 原因就是我们设置的端口没有生效,解决方案:
删除pom.xml中配置的端口信息,再次启动,就ok了,之前的端口不变.
提示:
如果是nacos之类的远程配置,别忘记删除配置中的端口