Windows環境下,SpringBoot項目啟動時報端口號占用:
***************************
APPLICATION FAILED TO START
***************************Description:Web server failed to start. Port 8080 was already in use.Action:Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
于是換個端口號試試,還是提示占用。
通過netstat查看當前端口號并沒有被占用啊,那可能是使用了系統保留端口,通過 netsh interface ipv4 show excludedportrange protocol=tcp
查看:
協議 tcp 端口排除范圍
開始端口 結束端口
---------- --------7681 77807781 78807900 79998000 80998100 81998200 82998300 839950000 50059
方法:
1、換個端口(不在系統保留端口的范圍)
2、關閉hyper-v
參考:
https://developer.aliyun.com/article/977707
https://www.jianshu.com/p/5ad2c9f0c969