linux 系统下部署 TOMCAT 错误:java.net.UnknownHostExcepon: bogon: bogon
java.net.UnknownHostExcepon: bogon: bogon
at java.net.InetAddress.getLocalHost(InetAddress.java:1353)
at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:490)
at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:289)
at org.apache.jk.server.JkMain.pause(JkMain.java:681)
at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:163)
at org.apache.catalina.connector.Connector.pause(Connector.java:1032)
at org.apache.catalina.core.StandardService.stop(StandardService.java:489)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:734)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:602)
at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:645)
解决这个异常的方法是
主机映射的原因。
修改 etc/hosts 文件
用 root 用户登陆后
[root@bogon ~]# vi /etc/hosts
将看到如下代码:
# Do not remove the following line, or various programs
# that require network funconality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
将以上代码修改成 也就是加个 bogon
# Do not remove the following line, or various programs
# that require network funconality will fail.
127.0.0.1 bogon localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
然后按 ESC 冒号 wq 保存后退出 reboot 重启后生效。
问道解决。以上异常就不会出现了。一切 OK 了。
评论15
最新资源