最近写一个项目Tomcat启动是没问题的,最近不知怎么了,启动的时候总是出现 bogon: bogon: nodename nor servname provided, or not known 错误,如下
/Users/liurenkui/myLibrary/apache-tomcat-7.0.88/bin/catalina.sh run [2018-07-04 05:57:56,983] Artifact am:war exploded: Waiting for server connection to start artifact deployment... 错误: 代理抛出异常错误: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: bogon: bogon: nodename nor servname provided, or not known Disconnected from server
网上查了一下,好像和路由映射有关系,最后查一篇文章说这个问题只有mac会遇到,处理方法就是对bogon做个DNS解析指向127.0.0.1.
修改文件/etc/hosts,在里面增加对127.0.0.1的解析.
127.0.0.1 bogon localhost
保存生效后,再启动tomcat就没这个问题了.
未经允许请勿转载:程序喵 » Java Web项目在Mac系统上启动时提示nodename nor servname provided的解决办法