本文介绍了的java.net.UnknownHostException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jdk1.6.0_23安装CSVN并且我收到以下Java错误:

I'm installing CSVN using jdk1.6.0_23 and I'm getting the following Java error:

2011-02-10 16:25:50,951 [WrapperJarAppMain] WARN util.GrailsUtil - [WARNING] Property [ldapServerPort] of domain class com.collabnet.svnedge.console.Server has type [int] and doesn't support constraint [nullable]. This constraint will not be checked during validation.
2011-02-10 16:25:51,117 [WrapperJarAppMain] ERROR ehcache.Cache - Unable to set localhost. This prevents creation of a GUID. Cause was: vkqgae01: vkqgae01
java.net.UnknownHostException: vkqgae01: vkqgae01
at java.net.InetAddress.getLocalHost(InetAddress.java:1354)
at net.sf.ehcache.Cache.<clinit>(Cache.java:143)

我的服务器有3个NIC(eth0,eth1和eth2)。我在以下主机文件中添加了一个条目,包含以下内容:
127.0.0.1 vkqgae01

My server has 3 NICs (eth0, eth1 and eth2). I've added an entry to the hosts file bellow localhost containing the following:127.0.0.1 vkqgae01

我可以成功ping vkqgae01,但是nslookup无法解析它。

I can succesfully ping vkqgae01, but nslookup cannot resolve it.

任何想法?

推荐答案

这与

如果/ etc / hosts不不包含它失败的主机名的定义。只需将您的主机名添加到/ etc / host,例如,如果您的主机名是工作添加或修改以下行:

If /etc/hosts doesn't containt the definition of the hostname it fails. Just add your hostname to /etc/host for example if your hostname is work add or modified the following line:

127.0.0.1   work        localhost

这篇关于的java.net.UnknownHostException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 15:19
查看更多