在一个网络项目中。
我看到日志:
hadoop.hbase.zookeeper.ZKConfig - java.net.UnknownHostException: example.com
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:850)
at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1201)
at java.net.InetAddress.getAllByName0(InetAddress.java:1154)
at java.net.InetAddress.getAllByName(InetAddress.java:1084)
at java.net.InetAddress.getAllByName(InetAddress.java:1020)
at java.net.InetAddress.getByName(InetAddress.java:970)
但是当我ping example.com时,没关系,我也telnet example.com 2181成功!我发现了类似的问题
,所以我在我的服务器 java DomainResolutionTest example.com
中运行 DomainResolutionTest
但没关系!
环境:
java -version
java 版本 "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, 混合模式)
os:Red Hat Enterprise Linux Server release 5.7
我很好奇为什么是Inet6AddressImpl,我想可能是Inet4AddressImpl
如何解决?
是什么原因?