首页 > 代码库 > java.net.BindException: Cannot assign requested address
java.net.BindException: Cannot assign requested address
tomcat启动后报错
2017-6-7 17:23:49 org.apache.catalina.core.StandardServer await
严重: StandardServer.await: create[localhost:8005]:
java.net.BindException: Cannot assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:422)
at org.apache.catalina.startup.Catalina.await(Catalina.java:707)
at org.apache.catalina.startup.Catalina.start(Catalina.java:653)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
2017-6-7 17:23:49 org.apache.coyote.AbstractProtocolHandler pause
信息: Pausing ProtocolHandler ["http-bio-8080"]
2017-6-7 17:06:51 org.apache.coyote.AbstractProtocolHandler pause
信息: Pausing ProtocolHandler ["ajp-bio-8009"]
2017-6-7 17:23:57 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service Catalina
2017-6-7 17:23:57 org.apache.coyote.AbstractProtocolHandler stop
信息: Stopping ProtocolHandler ["http-bio-8080"]
2017-6-7 17:23:57 org.apache.coyote.AbstractProtocolHandler stop
信息: Stopping ProtocolHandler ["ajp-bio-8009"]
原因是:hosts中的localhost对应的IP地址非本机地址
修改正确重启tomcat即正常
10.1.170.16 localhost.localdomain localhost
java.net.BindException: Cannot assign requested address
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。