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

##场景 Idea开启多个springboot程序后 

    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.lpinfo.LpinfoApplication.main(LpinfoApplication.java:18)
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)

##看到 Caused by: java.net.BindException: Address already in use: bind 知道端口占用引起的

##解决方案(windows下)

     #查询出8080端口被那些进程占用着
    netstat -ano | findstr 8080
    #关闭进程
    tasklist | findstr <进程号>
    #强制关闭
    taskkill -PID <进程号> -F

posted @ 2020-05-09 10:53  蜜獾互联网  阅读(17)  评论(0编辑  收藏  举报  来源