zoukankan      html  css  js  c++  java
  • 解决 搭建Jekins过程中 启动Tomcat的java.net.UnknownHostException异常

    11-Nov-2016 06:01:33.229 WARNING [Computer.threadPoolForRemoting [#1]] null.null Could not intialize the host network interface on nullbecause of an error: myserver: myserver: unknown error
     java.net.UnknownHostException: myserver: myserver: unknown error
        at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
        at javax.jmdns.impl.HostInfo.newHostInfo(HostInfo.java:75)
        at javax.jmdns.impl.JmDNSImpl.<init>(JmDNSImpl.java:407)
        at javax.jmdns.JmDNS.create(JmDNS.java:60)
        at hudson.DNSMultiCast$1.call(DNSMultiCast.java:33)
        at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.net.UnknownHostException: myserver: unknown error
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
        ... 9 more

    在Linux Tomcat下启动Jekins的时候报以上的错误,究其原因是因为服务器配置了自定义的host name 没有在hosts文件中定义.

    解决方法如下:

    1. 查看自己服务器的host name

    # hostname

    2. 进入etc/hosts 编辑,在下面加一行:

      127.0.0.1  你的hostname

    3. 保存退出,重启tomcat.解决

  • 相关阅读:
    时间日期date/cal
    chown命令
    su命令
    which命令和bin目录
    python基础之文件操作
    python之模块之shutil模块
    python基础之面向对象01
    python基础之面向对象02
    python基础之map/reduce/filter/sorted
    python基础之模块之序列化
  • 原文地址:https://www.cnblogs.com/jackstrong/p/6054341.html
Copyright © 2011-2022 走看看