Spring Boot 报错:Caused by: java.net.BindException: Address already in use: bind

Spring Boot 报错:Protocol handler start failed

Caused by: java.net.BindException: Address already in use: bind

报错代码

org.apache.catalina.LifecycleException: Protocol handler start failed
	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardService.addConnector(StandardService.java:226)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:259)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:311)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:164)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
	at com.zzf.sell.SellApplication.main(SellApplication.java:10)
Caused by: java.net.BindException: Address already in use: bind
	at sun.nio.ch.Net.bind0(Native Method)
	at sun.nio.ch.Net.bind(Net.java:433)
	at sun.nio.ch.Net.bind(Net.java:425)
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
	at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:236)
	at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210)
	at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1085)
	at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1171)
	at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:568)
	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005)
	... 14 common frames omitted
- Pausing ProtocolHandler ["http-nio-8080"]
- Stopping service [Tomcat]
- The stop() method was called on component [StandardServer[-1]] after stop() had already been called. The second call will be ignored.
- Stopping ProtocolHandler ["http-nio-8080"]
- Destroying ProtocolHandler ["http-nio-8080"]
- 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
- 

***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.

- Shutting down ExecutorService 'applicationTaskExecutor'
- Closing JPA EntityManagerFactory for persistence unit 'default'
- HikariPool-1 - Shutdown initiated...
- HikariPool-1 - Shutdown completed.

Process finished with exit code 1

错误原因:

8080端口被占用了

解决办法:

关闭占用端口号的进程,我的错误是因为我开了另一个eclipse,并且打开了tomcat。
一般解决就是关闭任务管理器中的javac.exe,不行吧java.exe 也全部关闭。

下面是网上其他人的解决方法:

查看当前端口被哪个进程占用了(CMD)

netstat -ano|findstr "8080"
在这里插入图片描述

查找进程名称

tasklist|findstr "2700"
在这里插入图片描述

关闭进程

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小胖丨学编程

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值