报错: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 子进程)的进程。


然后重新启动项目即可。


相关文章
|
7月前
|
开发框架 监控 安全
Windows Defender 导致 Web IIS 服务异常停止排查
某日凌晨IIS服务异常停止,经查为Windows Defender安全补丁KB2267602触发引擎更新,导致系统资源波动,进而引发应用池回收。确认非人为操作,系统无重启。通过分析日志与监控,定位原因为Defender更新后扫描加重负载。解决方案:将IIS及.NET相关路径添加至Defender排除列表,避免业务影响。
791 116
|
7月前
|
Java 测试技术 网络安全
Burp Suite Professional 2025.10 for Windows x64 - 领先的 Web 渗透测试软件
Burp Suite Professional 2025.10 for Windows x64 - 领先的 Web 渗透测试软件
320 0
Burp Suite Professional 2025.10 for Windows x64 - 领先的 Web 渗透测试软件
|
10月前
|
安全 Linux iOS开发
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
761 0
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
|
12月前
|
人工智能 安全 网络安全
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
572 4
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
|
10月前
|
前端开发 Java API
Spring Cloud Gateway Server Web MVC报错“Unsupported transfer encoding: chunked”解决
本文解析了Spring Cloud Gateway中出现“Unsupported transfer encoding: chunked”错误的原因,指出该问题源于Feign依赖的HTTP客户端与服务端的`chunked`传输编码不兼容,并提供了具体的解决方案。通过规范Feign客户端接口的返回类型,可有效避免该异常,提升系统兼容性与稳定性。
701 0
|
12月前
|
安全 Devops 测试技术
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
232 0
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
|
人工智能 Linux iOS开发
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
873 12
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
|
安全 JavaScript Java
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
250 12
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
|
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服务器能够顺利启动和运行。 只有锻炼思维才能可持续地解决问题,只有思维才是真正值得学习和分享的核心要素。如果这篇博客能给您带来一点帮助,麻烦您点个赞支持一下,还可以收藏起来以备不时之需,有疑问和错误欢迎在评论区指出~
|
自然语言处理 安全 测试技术
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
922 0
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试