linux报错 --- Failed to start bean ‘webServerStartStop‘; nested exception is org.springframework.

💛环境:window10、CentOs7.5.1804

💦专栏:linux_debug

linux_debug:Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.

1.错误信息

2022-07-08 18:12:25.088 ERROR 33600 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.21.jar!/:5.3.21]
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.21.jar!/:5.3.21]
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.21.jar!/:5.3.21]
	at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_333]
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.21.jar!/:5.3.21]
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.21.jar!/:5.3.21]

2. 问题说明

在linux上运行springboot项目打成的jar包时;

  • 出现上述问题,说明8080端口被占用;

3.解决方法

关闭被占用的8080端口;

3.1 windows

  • 在cmd中输入
# 找到对应的pid
netstat -ano | findstr 8080

## out:TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 6148
  • 关闭端口对应的pid号,假设端口8080对应的是进程号为123的进程号
taskkill /pid 6148 -t -f

3.2 linux

  • 在cmd中输入
# 找到对应的pid
netstat -ano | grep 8080

## out:TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 6148
  • 关闭端口对应的pid号,假设端口8080对应的是进程号为123的进程号
kill -9 PID 123
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值