日志
***************************
APPLICATION FAILED TO START
***************************
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.
提示服務啟動失敗,端口
8081
被占用了。
端口被占用了,就說明有其他服務使用了該端口,我們需要找到該服務,并手動終止。
解決
以Windows為例,在DOS視窗查找占用該端口的服務。
使用快捷鍵
win + r
,并輸入
cmd
回車,打開DOS視窗。以下指令操作都在DOS視窗執行。
- 查詢占用端口應用的PID值
netstat -aon|findstr [端口号]
- 查詢指定PID的程序
tasklist|findstr [PID值]
- 結束占用端口的程序
taskkill /T /F /PID [PID值]
以上操作後,再重新啟動服務就可以了
ps:根據第二步可以檢視是什麼應用程序占用了該端口,若該應用程序無用,就可以直接通過第三步殺死該程序,若有用就隻能更改目前服務的端口了