我们做WEB开发,本地调试时,有时出现:
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer.start(JettyEmbeddedServletContainer.java:113)
... 7 more
如果配置的是80端口,打开cmd, 输入命令:netstat -aon|findstr "80",回车,记下最后一位数字,即PID,这里是15096。
继续输入tasklist|findstr "15096",回车,查看是哪个进程或者程序占用了80端口
从任务管理器中结束该进程,80端口就不会被占用,同样也要检查一下443端口,将占用443端口的进程也退出,当前程序就可以使用了。
来源:CSDN
作者:梦想272
链接:https://blog.csdn.net/chunzhiyan/article/details/104633127