报错:Web server failed to start. Port 9002 was already in use.端口被占用解决(Windows)

简介: 报错:Web server failed to start. Port 9002 was already in use.端口被占用解决(Windows)

场景

在开发的时候,启动了项目,端口也是占用的,如果发生了意外,关掉了项目,比如IDEA突然关了或者卡死了,你不得不重新打开,重新去启动的时候,发现启动不了了,控制台的信息如下:

***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 9002 was already in use.
Action:
Identify and stop the process that's listening on port 9002 or configure this application to listen on another port.
Process finished with exit code 1


原因

启动原因说得非常明白,就是说端口被占用了,你只需要杀死相应的进程,重新启动即可。

操作

如果是Linux系统,找到相应的进程id,kill调即可。

此处记录Windows的场景,打开CMD界面:


C:\Users\shaonaiyi>netstat -ano |findstr "9002"
  TCP    0.0.0.0:9002           0.0.0.0:0              LISTENING       7900
  TCP    127.0.0.1:9002         127.0.0.1:52203        TIME_WAIT       0
  TCP    127.0.0.1:9002         127.0.0.1:52204        TIME_WAIT       0
  TCP    [::]:9002              [::]:0                 LISTENING       7900
C:\Users\shaonaiyi>taskkill /f /t /im "7900"
成功: 已终止 PID 7900 (属于 PID 2296 子进程)的进程。


然后重新启动项目即可。


相关文章
|
Linux 虚拟化 Windows
Linux、Windows上还不会端口映射的网工,请低调看过来!
Linux、Windows上还不会端口映射的网工,请低调看过来!
312 0
|
应用服务中间件 nginx
【报错】Failed to start A high performance web server and a reverse proxy server.
【报错】Failed to start A high performance web server and a reverse proxy server.
875 2
|
7月前
|
JavaScript 前端开发 Java
Idea启动SpringBoot程序报错:Veb server failed to start. Port 8082 was already in use;端口冲突的原理与解决方案
本文解决了Idea启动SpringBoot程序报错:Veb server failed to start. Port 8082 was already in use的问题,并通过介绍端口的使用原理和操作系统的端口管理机制,可以更有效地解决端口冲突问题,并确保Web服务器能够顺利启动和运行。 只有锻炼思维才能可持续地解决问题,只有思维才是真正值得学习和分享的核心要素。如果这篇博客能给您带来一点帮助,麻烦您点个赞支持一下,还可以收藏起来以备不时之需,有疑问和错误欢迎在评论区指出~
|
8月前
|
Windows
windows查看端口占用情况
windows查看端口占用情况
344 9
|
8月前
|
网络协议 Java Shell
java spring 项目若依框架启动失败,启动不了服务提示端口8080占用escription: 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-优雅草卓伊凡解决方案
java spring 项目若依框架启动失败,启动不了服务提示端口8080占用escription: 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-优雅草卓伊凡解决方案
415 7
|
12月前
|
监控 Java Linux
问题回顾:Unable to start web server; nested exception is org.springframework.boot.web.server.
解决“Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException”这一问题,关键在于细致的故障诊断和逻辑推理。从日志入手,逐步排查端口冲突、依赖问题、配置错误、资源限制、代码bug以及版本兼容性等多个方面,最终定位并解决根本原因。每一步操作都应谨慎且有针对性,确保修改一处后充分测试,避免引入新的问题。
3109 0
Windows中如何查看被占用的端口、杀掉对应的进程
这篇文章介绍了在Windows系统中如何查看被占用的端口号以及如何杀掉占用端口的进程,包括使用命令提示符的`netstat -ano | findstr 端口号`命令查找进程PID,然后通过任务管理器或`taskkill /PID PID号`命令来结束进程。
Windows中如何查看被占用的端口、杀掉对应的进程
|
Windows
windows端口冲突解决办法
windows端口冲突解决办法
407 1
windows端口冲突解决办法
|
Windows
Windows——80端口被系统占用
Windows——80端口被系统占用
189 0
|
缓存 数据安全/隐私保护 虚拟化
windows端口被占用,无法通过netstat找到进程,占用的端口又不能修改,该怎么办?
项目运行时服务器8080端口被占用,常规`netstat`命令找不到占用进程。解决方法包括:1) 强制关机重启释放端口;2) 使用`netstat -anobq`或Windows 10的`Get-NetTCPConnection` PowerShell命令查找BOUND状态的进程;3) 调整Windows动态端口范围,避免冲突。注意,强制关机可能影响数据安全。
4172 2

热门文章

最新文章