注:xxx:代表服务器名称
报错代码:
[ERROR]-[Thread: localhost-startStop-1]-[net.sf.ehcache.Cache.<clinit>()]: Unable to set localhost. This prevents creation of a GUID. Cause was: xxx: 未知的名称或服务
java.net.UnknownHostException: xxx: 未知的名称或服务
at java.net.InetAddress.getLocalHost(InetAddress.java:1475)
............
Caused by: java.net.UnknownHostException: xxx: 未知的名称或服务
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1295)
at java.net.InetAddress.getLocalHost(InetAddress.java:1471)
... 32 more
解决方案:
修改hosts文件 映射host名到127.0.0.1
vim /etc/hosts
127.0.0.1 xxx localhost