Linux

Couldn't discover local host java.net.UnknownHostException

Naan 2015. 5. 4. 09:29
320x100

2015.05.03 19:41:27 org.jivesoftware.openfire.filetransfer.proxy.FileTransferProxy - Couldn't discover local host

java.net.UnknownHostException: spark: spark: unknown error

        at java.net.InetAddress.getLocalHost(InetAddress.java:1484)

        at org.jivesoftware.openfire.filetransfer.proxy.FileTransferProxy.initialize(FileTransferProxy.java:195)

        at org.jivesoftware.openfire.XMPPServer.initModules(XMPPServer.java:618)

        at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:504)

        at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:216)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

        at java.lang.Class.newInstance(Class.java:442)

        at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:105)

        at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56)

Caused by: java.net.UnknownHostException: spark: unknown error

        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)

        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:907)

        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1302)

        at java.net.InetAddress.getLocalHost(InetAddress.java:1479)

        ... 11 more


로그 화일중에 위와 같이 에러가 발생한다면.

# hostname

spark

hostname 이 spark 라면

#vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


127.0.0.1   spark localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


hostname 을 추가로 등록해주면 에러가 발생 안한다.

320x100