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对应的那条。
相关推荐
claytang 2010-03-09
lonyness 2019-10-27
84487600 2019-07-01
tomson 2015-07-09
kongjunlongaa 2019-06-27
89590599 2019-06-26
mofgeng 2008-04-26
Sincelily 2011-09-29
langqiao 2011-04-26
GoodLuckAC 2018-07-21
zhaojikun 2019-04-16
pythonpycharm 2019-04-16
PHP100 2019-03-27
读立写生 2018-04-17
软件设计 2017-04-08
编程爱好者联盟 2016-11-25