In regards to this question Play Framework GUID why do I have to change my hosts file? I was having a similar issue while running a test in fedora which returned the following error
[error] (*:testListeners) java.net.UnknownHostException: fedora: fedora: Name
or service not known
I added the line
127.0.0.1 localhost fedora
to my /etc/hosts file, which fixed this, but why should this have to be done in the first place?
Play server loads EhCache. When EhCache is loaded (specifically
net.sf.ehcache.Cache
) it attempts to determine the address for localhost which is used in a process to create GUIDs identifying the cache instances created. EhCache does this by callingInetAddress.getLocalHost()
. This method searches your host file for an entry matching the hostname set for the local machine, if it doesn't find one it throws anUnknownHostException
.The fix, as demonstrated in an answer to the question you linked, is to set a host entry for the local hostname.