2013-06-12 43 views
0

我有一些簡單的聲明,請指導我,是什麼問題。Grails - inetAddress - 錯誤

String localhostname = java.net.InetAddress.getLocalHost().getHostName() 

我得到這個錯誤:

Loading Grails 2.3.0.M1 | Error There was an error loading the 
BuildConfig: mysystem-lnx: 
Temporary failure in name resolution (NOTE: Stack trace has been 
filtered. Use --verbose to see entire trace.) 
java.net.UnknownHostException: mysystem-lnx : Temporary failure in 
name resolution  at java_net_InetAddress$getLocalHost.call(Unknown 
Source)  at 
BuildConfig$_run_closure1_closure3.doCall(BuildConfig.groovy:65) at 
BuildConfig$_run_closure1_closure3.doCall(BuildConfig.groovy) at 
org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243) 
at BuildConfig$_run_closure1.doCall(BuildConfig.groovy:59) at 
BuildConfig$_run_closure1.doCall(BuildConfig.groovy) at 
org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243) 
at 
grails.util.BuildSettings.configureDependencyManager(BuildSettings.groovy:1240) 
at 
grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:1186) 
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1082) 
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1046) 
at grails.util.BuildSettings$loadConfig.callCurrent(Unknown Source) 
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1024) 
at 
org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243) 
Caused by: java.net.UnknownHostException: mysystem-lnx: 
Temporary failure in name resolution ... 15 more | Error There was an 
error loading the BuildConfig: mysystem-lnx: 
mysystem-lnx: Temporary failure in name resolution 
+0

看起來像一個DNS /主機問題 –

回答

0

我不能夠解決這個問題。它只發生在我的Linux中。在我的朋友Linux中它工作正常。所以,

我剛加入了try catch塊。