Getting local host via InetAddress.getLocalHost() under Linux
Hi,
Whatever I do, Linux machines in my project throw an exception when calling java.net.InetAddress.getLocalHost().
Googling about it confirmed there's an issue here, ancient as the moon, but I could not find any solution.
This nasty behavior hinders initialization of ehcache and execution of jmeter tests, just to name a few places.
I stopped using it from my code altogether, but some code that uses it (as these two examples) resides in my 3rd party libraries.
Does anybody know of a fix to this issue? whether java-based or network configuration, any suggestion is welcome...
Thanks!
Zvika

Comments
Is the ancient issue you're talking about related to host name? what's your host name? are we talking about JBoss?
thanks,
yes, it's related to obtaining hostname (or IP),
and no, it is not related to JBoss
I had problems with InetAddress.getLocalHost() when /etc/hosts did not contains the correct host mapping, something like:
127.0.0.1 shalom.localdomain shalom localhost.localdomain localhost
right on the money! thanks :)