Unable to set localhost. This prevents creation of a GUID

linux启动项目的时候报这个相关的错误,

 

 ERROR [main] Cache.<clinit>(202) | Unable to set localhost. This prevents creation of a GUID. Cause was: centos: centos
java.net.UnknownHostException: centos: centos
        at java.net.InetAddress.getLocalHost(InetAddress.java:1374)

 

原因没有给自己的机器名称做映射,在hosts文件中将127.0.0.1 映射到本机名称centos即可

 

参考:http://www.oecp.cn/hi/wlo_o/blog/1168712

你可能感兴趣的:(localhost)