• java.net.BindException: Cannot assign requested address: bind


    异常信息

    时间:2017-03-16 10:21:05,644 - 级别:[ERROR] - 消息: [other] Failed to start end point associated with ProtocolHandler ["http-nio-192.168.200.116-10001"] - 位置:org.apache.coyote.http11.Http11NioProtocol:182
    java.net.BindException: Cannot assign requested address: 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.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:340)
        at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:773)
        at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:473)
        at org.apache.catalina.connector.Connector.startInternal(Connector.java:986)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.StandardService.addConnector(StandardService.java:239)
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:194)
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:151)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
        at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
        at hls.itms.web.collect.CollectApplication.main(CollectApplication.java:24)
    时间:2017-03-16 10:21:05,645 - 级别:[ERROR] - 消息: [other] Failed to start connector [Connector[HTTP/1.1-10001]] - 位置:org.apache.catalina.core.StandardService:182
    org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-10001]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
        at org.apache.catalina.core.StandardService.addConnector(StandardService.java:239)
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:194)
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:151)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
        at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
        at hls.itms.web.collect.CollectApplication.main(CollectApplication.java:24)
    Caused by: org.apache.catalina.LifecycleException: service.getName(): "Tomcat";  Protocol handler start failed
        at org.apache.catalina.connector.Connector.startInternal(Connector.java:993)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        ... 13 common frames omitted

    两种情况:

    1.端口号被占用,导致地址无法绑定

    windows查看端口pid
    netstat -aon|findstr 8080(端口号)
    
    linux查看端口占用
    netstat -anp|grep 8080

    2.ip地址与本机地址不匹配,导致地址无法绑定

    windows查看ip
    ipconfig
    
    linux查看ip
    ifconfig

     

  • 相关阅读:
    二次离线莫队
    一些不等积分的练习(持续更新)
    杂题20210427
    杂题20210415
    杂题20210203
    php pack()函数详解与示例
    SHOI2020抱灵祭
    BJOI2021游记+题解
    博客搬家
    听课记录 210220【分治,树分治,CDQ分治】
  • 原文地址:https://www.cnblogs.com/skyessay/p/6558196.html
Copyright © 2020-2023  润新知