我正在使用Play 2.3.7,我最近在启动应用程序时开始看到此错误。我最近一直在尝试使用FakeApplication
类编写一些测试,但我不确定是不是这导致了这个:
[info] play - database [default] connected at jdbc:postgresql://localhost/gsn
[error] n.s.e.Cache - Unable to set localhost. This prevents creation of a GUID. Cause was: MacBook-Pro.local: MacBook-Pro.local: nodename nor servname provided, or not known
java.net.UnknownHostException: MacBook-Pro.local: MacBook-Pro.local: nodename nor servname provided, or not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1473) ~[na:1.7.0_71]
at net.sf.ehcache.Cache.<clinit>(Cache.java:214) ~[ehcache-core-2.6.8.jar:na]
at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:296) [ehcache-core-2.6.8.jar:na]
at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:219) [ehcache-core-2.6.8.jar:na]
at net.sf.ehcache.CacheManager.configure(CacheManager.java:722) [ehcache-core-2.6.8.jar:na]
Caused by: java.net.UnknownHostException: MacBook-Pro.local: nodename nor servname provided, or not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.7.0_71]
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901) ~[na:1.7.0_71]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293) ~[na:1.7.0_71]
at java.net.InetAddress.getLocalHost(InetAddress.java:1469) ~[na:1.7.0_71]
at net.sf.ehcache.Cache.<clinit>(Cache.java:214) ~[ehcache-core-2.6.8.jar:na]
[info] play - Application started (Dev)
也许它与数据库连接有关,因为它在初始连接时出现?有趣的是,此后应用程序仍然可以正常运行。
任何帮助将不胜感激,谢谢!