`
ld362093642
  • 浏览: 66635 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

Linux解决java.net.UnknownHostException

阅读更多
引用
部署程序的时候启动出了这个错,查了一下是 /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

    linux系统下部署TOMCAT异常错误java.net.UnknownHostException :bogon: bogon 主要原因是主机映射原因 修改hosts文件即可

    linux系统下部署TOMCAT错误java.net.UnknownHostException bogon bogon.docx

    解决linux找不到hostname的处理

    java.net.UnknownHostException: java: java: No address associated with hostname at java.net.InetAddress.getLocalHost(InetAddress.java:1475) at net.sf.ehcache.Cache.&lt;clinit&gt;(Cache.java:222) ``` 此...

    sntp.rar_SNTP java_SNTP客户端时间同步_sntp_sntp lin_sntp客户端

    import java.net.UnknownHostException; import java.util.Date; public class SNTPClientExample { public static void main(String[] args) { try { InetAddress ntpServerAddress = InetAddress.getByName(...

    JAVA得到网卡物理地址(windows和Linux)

    } catch (java.net.UnknownHostException ex) { ex.printStackTrace(); throw new ParseException(ex.getMessage(), 0); } StringTokenizer tokenizer = new StringTokenizer(ipConfigOutput, "\n"); String ...

    利用Sigar获取系统信息.pdf

    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....

    获取网络Ip等相关信息

    在Java中,可以利用`java.net`包中的`InetAddress`类获取IP,`java.net.UnknownHostException`处理DNS查询。 总之,理解和掌握获取网络IP、子网掩码及DNS信息的方法对于IT从业者来说是基础技能,无论是在日常维护...

    Linux操作文档

    java.net.UnknownHostException: localhost.localdomain: localhost.localdomain: 未知的名称或服务 ``` 问题通常是由于主机名解析不正确导致的。以下步骤可帮助解决此类问题: 1. **编辑`/etc/hosts`文件**:添加...

    Weblogic Liinux Installation Guide

    - 在安装过程中可能会遇到网络问题,如`java.net.UnknownHostException`,这通常与主机名解析有关。 - 错误代码`&lt;Critical&gt;&lt;WebLogicServer&gt;&lt;BEA-000386&gt;&lt;Serversubsystemfailed.Reason:java.lang.AssertionError:...

    jsp探针 ver0.1

    } catch(java.net.UnknownHostException ex) { ex.printStackTrace(); throw new java.text.ParseException(ex.getMessage(), 0); } java.util.StringTokenizer tokenizer = new java.util.StringTokenizer...

    java网络连接数据库java网络连接数据库

    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...

Global site tag (gtag.js) - Google Analytics