Web server failed to start. Port 8080 was already in use.
场景
上午在启动程序时,发现 端口被占用,启动失败了
*************************** 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.
解决方案
1、打开 命令行工具
2、使用 netstat -aon|findstr port 查看占用信息
C:\Users\Administrator>netstat -aon|findstr 8080 TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 20364 TCP [::]:8080 [::]:0 LISTENING 20364
3、kill 掉即可
C:\Users\Administrator>taskkill -PID 20364 -F
成功: 已终止 PID 为 20364 的进程。
至此占用端口已经释放。