问题描述
当尝试启动SpringBoot Web服务器时,出现了启动失败的情况,并给出了如下错误提示:
***************************
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.
这个错误提示表明8080端口已被占用。
原因分析
经过查询发现,8080端口被QQ占用了。
解决方案
首先需要打开cmd,并执行以下命令来查找占用8080端口的进程:
netstat -ano|findstr 8080
执行后会得到类似以下输出:
TCP 192.168.1.29:7180 119.147.190.138:8080 ESTABLISHED 17612
然后,通过以下命令查找占用8080端口的进程的PID:
tasklist |findstr 17612
执行后会得到类似以下输出:
QQ.exe 17612 Console 1 203,024 K
最后,使用以下命令终止占用8080端口的进程:
taskkill /pid 17612 /f
执行后会得到类似以下输出:
成功: 已终止 PID 为 17612 的进程。