Java – running Grails in a remote environment

I have a "named" server, which seems to cause Grails to be unable to find localhost

Running Grails application..
2011-01-12 20:45:14,046 [main] ERROR ehcache.Cache  - Unable to set localhost. This prevents creation of a GUID. Cause was: zaftra: zaftra
java.net.UnkNownHostException: zaftra: zaftra
    at java.net.InetAddress.getLocalHost(InetAddress.java:1426)
    at net.sf.ehcache.Cache.<clinit>(Cache.java:143)
    at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:463)
    at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:369)
    at net.sf.ehcache.CacheManager.configure(CacheManager.java:445)
    at net.sf.ehcache.CacheManager.init(CacheManager.java:302)
    at net.sf.ehcache.CacheManager.<init>(CacheManager.java:260)
    at net.sf.ehcache.hibernate.EhCacheProvider.start(EhCacheProvider.java:128)

/Contents of etc / hosts (as shown in the figure):

127.0.0.1       localhost localhost.localdomain zaftra
::1       localhost localhost.localdomain zaftra

Solution

I'll assume you have some Linux style If this is the case, you can look at the / etc / hosts file – is there a localhost entry? I want to see something similar:

127.0.0.1     localhost zaftra
::1           localhost

I did some Google searches – the super user has more than a similar question – and suggested adding the following to / etc / resolv conf:

search (domainname) // in your case,search (zaftra)

You can also try:

search zaftra
// or
search zaftra.example.com // if there's a more fully-qualified domain name you can use

This is based on an entry I entered in resolv.conf on one of my Ubuntu machines

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>