Skip to content
Advertisement

A strange UnknownHostException

In a web project .
I see the log:

JavaScript

but when I ping example.com, it’s ok, I also telnet example.com 2181 successfully! I found the similar question so I run the DomainResolutionTest in my Server java DomainResolutionTest example.com
but it’s ok !

env:

JavaScript

java version “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, mixed mode)

os:Red Hat Enterprise Linux Server release 5.7

I am curious why is Inet6AddressImpl,I think it may be Inet4AddressImpl

How to solve it?
What’s the cause ?

Advertisement

Answer

i have had the same exception and solved it by setting my hostname manually in /etc/hosts for the ‘localhost’ entry both.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement