引用
部署程序的时候启动出了这个错,查了一下是 /etc/hosts文件的问题
17:46:51,770 ERROR ~ Unable to set localhost. This prevents creation of a GUID. Cause was: wdse57: wdse57: Name or service not known
java.net.UnknownHostException: wdse57: wdse57: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
at net.sf.ehcache.Cache.<clinit>(Cache.java:155)
at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:298)
at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:214)
at net.sf.ehcache.CacheManager.configure(CacheManager.java:552)
at net.sf.ehcache.CacheManager.init(CacheManager.java:323)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:279)
at net.sf.ehcache.CacheManager.create(CacheManager.java:641)
at play.cache.EhCacheImpl.<init>(EhCacheImpl.java:31)
at play.cache.EhCacheImpl.newInstance(EhCacheImpl.java:41)
at play.cache.Cache.init(Cache.java:241)
at play.Play.start(Play.java:511)
at play.Play.detectChanges(Play.java:618)
at play.Invoker$Invocation.init(Invoker.java:198)
at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:195)
at play.Invoker$Invocation.run(Invoker.java:276)
at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:235)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.net.UnknownHostException: wdse57: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
... 23 more
引用
解决方法是修改etc/hosts文件
用root用户登陆后 vi /etc/hosts
把 wdse57 = ip 写到hosts里边 :wq 保存后退出 reboot重启后生效
如: 127.0.0.1 wdse57 localhost
这个wdse57不是固定的
分享到:
相关推荐
linux系统下部署TOMCAT异常错误java.net.UnknownHostException :bogon: bogon 主要原因是主机映射原因 修改hosts文件即可
java.net.UnknownHostException: java: java: No address associated with hostname at java.net.InetAddress.getLocalHost(InetAddress.java:1475) at net.sf.ehcache.Cache.<clinit>(Cache.java:222) ``` 此...
import java.net.UnknownHostException; import java.util.Date; public class SNTPClientExample { public static void main(String[] args) { try { InetAddress ntpServerAddress = InetAddress.getByName(...
} catch (java.net.UnknownHostException ex) { ex.printStackTrace(); throw new ParseException(ex.getMessage(), 0); } StringTokenizer tokenizer = new StringTokenizer(ipConfigOutput, "\n"); String ...
import java.net.UnknownHostException; import java.util.Map; import java.util.Properties; import java.util.Timer; import java.util.TimerTask; import org.hyperic.sigar.CpuInfo; import org.hyperic.sigar....
在Java中,可以利用`java.net`包中的`InetAddress`类获取IP,`java.net.UnknownHostException`处理DNS查询。 总之,理解和掌握获取网络IP、子网掩码及DNS信息的方法对于IT从业者来说是基础技能,无论是在日常维护...
java.net.UnknownHostException: localhost.localdomain: localhost.localdomain: 未知的名称或服务 ``` 问题通常是由于主机名解析不正确导致的。以下步骤可帮助解决此类问题: 1. **编辑`/etc/hosts`文件**:添加...
- 在安装过程中可能会遇到网络问题,如`java.net.UnknownHostException`,这通常与主机名解析有关。 - 错误代码`<Critical><WebLogicServer><BEA-000386><Serversubsystemfailed.Reason:java.lang.AssertionError:...
} catch(java.net.UnknownHostException ex) { ex.printStackTrace(); throw new java.text.ParseException(ex.getMessage(), 0); } java.util.StringTokenizer tokenizer = new java.util.StringTokenizer...
import java.net.*; import java.io.*; public class MoreConnection{ private static void closeSocket(Socket socket) { if (socket != null) try { socket.close(); } catch (Exception e) { } } public...