tomcat standardServer.await: create[8005]:
在一台linux机器上装了tomcat6.0,启动后出现异常
Java代码
- StandardServer.await: create[8005]:
- java.net.BindException: Cannot assign requested address
- at java.net.PlainSocketImpl.socketBind(Native Method)
- at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
- 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:373)
- at org.apache.catalina.startup.Catalina.await(Catalina.java:642)
- at org.apache.catalina.startup.Catalina.start(Catalina.java:602)
- 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:288)
- at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
StandardServer.await: create[8005]: java.net.BindException: Cannot assign requested address at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) 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:373) at org.apache.catalina.startup.Catalina.await(Catalina.java:642) at org.apache.catalina.startup.Catalina.start(Catalina.java:602) 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:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
开始还以为是端口占用,在server.xml中将<Serverport="8005"shutdown="SHUTDOWN">改为其他端口,出现同样的错误。
翻了翻google出来邮件列表,里面说是因为localhostinterface没有配置好的原因。
于是pinglocalhost
直接去ping一个远程地址了,打开/etc/hosts,发现127.0.0.1后面的主机名由localhost被改成了给该机器分配的主机名,改回127.0.0.1localhost.localdomainlocalhost,重启network后,启动tomcat,一切正常。
如果需要更改服务器的主机名和域名,需要修改/etc/sysconfig/network的HOSTNAME及DOMAINNAME,不能修改/etc/hosts中127.0.0.1对应的那条。
相关推荐
Kafka 2020-09-18
Wepe0 2020-10-30
杜倩 2020-10-29
windle 2020-10-29
minerd 2020-10-28
mengzuchao 2020-10-22
Junzizhiai 2020-10-10
bxqybxqy 2020-09-30
风之沙城 2020-09-24
kingszelda 2020-09-22
大唐帝国前营 2020-08-18
yixu0 2020-08-17
TangCuYu 2020-08-15
xiaoboliu00 2020-08-15
songshijiazuaa 2020-08-15
xclxcl 2020-08-03
zmzmmf 2020-08-03
newfarhui 2020-08-03
likesyour 2020-08-01