java.net.MalformedURLException: Local host name unknown报错处理

  1. 云栖社区>
  2. 博客>
  3. 正文

java.net.MalformedURLException: Local host name unknown报错处理

zhangdiandong 2015-12-04 08:40:40 浏览938
展开阅读全文
linux 修改host后启动tomcat报错
错误: 代理抛出异常错误: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: centos4: centos4: 未知的名称或服务
Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: centos4: centos4: Name or service not known
原因是/etc/hosts文件里没有主机名为:centos4,解决方法就是在hosts文件中加入centos4,修改后的hosts的文件是:

127.0.0.1  centos4 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

网友评论

登录后评论
0/500
评论
zhangdiandong
+ 关注