java.net.UnknownHostException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

When kafka creates new consumers, it simply concatenate the name of your VM to generate the consumer id. So, your VM resolves localhost as the name of your VM, not whatever you had set. To solve, add kafka(or the name of VM) plus address to /etc/hosts

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • When I try to execute a Composition inside a CentOS VM I get this error: [game-of-life-default] $ /var/lib/jenkins/tools/com.soasta.jenkins.FakeInstallation/cloudtest-scommand-6367.118/bin/scommand url=http://192.168.1.115/concerto/ "username=Cloudtest Lite" ******** cmd=play wait format=junitxml name=/Refundo/Composition/BankApps java.net.UnknownHostException: CentOSNode.localdomain: CentOSNode.localdomain: Name or service not known at java.net.InetAddress.getLocalHost(Unknown Source) at org.codehaus.xfire.addressing.RandomGUID.<clinit>(RandomGUID.java:115) at org.codehaus.xfire.addressing.AddressingInHandler.<clinit>(AddressingInHandler.java:26) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.codehaus.xfire.client.CorrelatorHandler.class$(CorrelatorHandler.java:14) at org.codehaus.xfire.client.CorrelatorHandler.<init>(CorrelatorHandler.java:24) at org.codehaus.xfire.client.Client.<init>(Client.java:84) at org.codehaus.xfire.client.Client.<init>(Client.java:180) at org.codehaus.xfire.client.Client.<init>(Client.java:125) at org.codehaus.xfire.client.XFireProxyFactory.create(XFireProxyFactory.java:78) at com.soasta.common.xfire.ClientFactory.a(ClientFactory.java:139) at com.soasta.common.repository.webservice.RepositoryServiceClientFactory.getRepositoryServiceClient(RepositoryServiceClientFactory.java:51) at com.soasta.common.repository.webservice.RepositoryServiceClientFactory.getRepositoryServiceClient(RepositoryServiceClientFactory.java:41) at com.soasta.tools.scommand.commands.a.n(a.java:415) at com.soasta.tools.scommand.commands.c.c(c.java:119) at com.soasta.tools.scommand.a.a(a.java:124) at com.soasta.tools.scommand.Main.main(Main.java:25) Caused by: java.net.UnknownHostException: CentOSNode.localdomain: Name or service not known at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source) at java.net.InetAddress.getAddressesFromNameService(Unknown Source) ... 18 more Please your comments about this issue, thanks.
    via by Luis Cardozo,
  • When I try to execute a Composition inside a CentOS VM I get this error: [game-of-life-default] $ /var/lib/jenkins/tools/com.soasta.jenkins.FakeInstallation/cloudtest-scommand-6367.118/bin/scommand url=http://192.168.1.115/concerto/ "username=Cloudtest Lite" ******** cmd=play wait format=junitxml name=/Refundo/Composition/BankApps java.net.UnknownHostException: CentOSNode.localdomain: CentOSNode.localdomain: Name or service not known at java.net.InetAddress.getLocalHost(Unknown Source) at org.codehaus.xfire.addressing.RandomGUID.<clinit>(RandomGUID.java:115) at org.codehaus.xfire.addressing.AddressingInHandler.<clinit>(AddressingInHandler.java:26) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.codehaus.xfire.client.CorrelatorHandler.class$(CorrelatorHandler.java:14) at org.codehaus.xfire.client.CorrelatorHandler.<init>(CorrelatorHandler.java:24) at org.codehaus.xfire.client.Client.<init>(Client.java:84) at org.codehaus.xfire.client.Client.<init>(Client.java:180) at org.codehaus.xfire.client.Client.<init>(Client.java:125) at org.codehaus.xfire.client.XFireProxyFactory.create(XFireProxyFactory.java:78) at com.soasta.common.xfire.ClientFactory.a(ClientFactory.java:139) at com.soasta.common.repository.webservice.RepositoryServiceClientFactory.getRepositoryServiceClient(RepositoryServiceClientFactory.java:51) at com.soasta.common.repository.webservice.RepositoryServiceClientFactory.getRepositoryServiceClient(RepositoryServiceClientFactory.java:41) at com.soasta.tools.scommand.commands.a.n(a.java:415) at com.soasta.tools.scommand.commands.c.c(c.java:119) at com.soasta.tools.scommand.a.a(a.java:124) at com.soasta.tools.scommand.Main.main(Main.java:25) Caused by: java.net.UnknownHostException: CentOSNode.localdomain: Name or service not known at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source) at java.net.InetAddress.getAddressesFromNameService(Unknown Source) ... 18 more Please your comments about this issue, thanks.
    via by Luis Cardozo,
  • Liquibase seems to resolve the server host name against the machine hostname rather than 'localhost'. The problem is that, on the RHEL machine we've got, the hostname is not bound to localhost thus throwing an UnknownHostException during the static initialization of `LockDatabaseChangeLogGenerator`. You can see the logs below: {code} Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError: INFO | jvm 1 | 2015/04/29 14:17:46 | java.net.UnknownHostException: 160.RH6.5: Nom ou service inconnu INFO | jvm 1 | 2015/04/29 14:17:46 | at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) INFO | jvm 1 | 2015/04/29 14:17:46 | at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at java.net.InetAddress.getAddressesFromNameService(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at java.net.InetAddress.getLocalHost(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.util.NetUtil.getLocalHostName(NetUtil.java:41) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.sqlgenerator.core.LockDatabaseChangeLogGenerator.<clinit>(LockDatabaseChangeLogGenerator.java:28) INFO | jvm 1 | 2015/04/29 14:17:46 | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) INFO | jvm 1 | 2015/04/29 14:17:46 | at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at java.lang.reflect.Constructor.newInstance(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.sqlgenerator.SqlGeneratorFactory.<init>(SqlGeneratorFactory.java:40) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.sqlgenerator.SqlGeneratorFactory.getInstance(SqlGeneratorFactory.java:54) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.AbstractExecutor.applyVisitors(AbstractExecutor.java:22) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor.access$500(JdbcExecutor.java:36) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:300) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:112) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.lockservice.StandardLockService.init(StandardLockService.java:88) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:187) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:153) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.Liquibase.update(Liquibase.java:182) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.Liquibase.update(Liquibase.java:174) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:330) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:287) INFO | jvm 1 | 2015/04/29 14:17:46 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571) INFO | jvm 1 | 2015/04/29 14:17:46 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509) {code} Until I bind "160.RH6.5" to localhost (via /etc/hosts), Liquibase will crash, preventing our installed app from starting. It should have resolved "localhost" instead. I did not try newer versions of Liquibase given this part (LockDatabaseChangeLogGenerator + NetUtil) has not changed much.
    via by Florent Biville,
  • RE: new installation, red5 won't run
    via by Philippe Dhont,
  • Liquibase seems to resolve the server host name against the machine hostname rather than 'localhost'. The problem is that, on the RHEL machine we've got, the hostname is not bound to localhost thus throwing an UnknownHostException during the static initialization of `LockDatabaseChangeLogGenerator`. You can see the logs below: {code} Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError: INFO | jvm 1 | 2015/04/29 14:17:46 | java.net.UnknownHostException: 160.RH6.5: Nom ou service inconnu INFO | jvm 1 | 2015/04/29 14:17:46 | at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) INFO | jvm 1 | 2015/04/29 14:17:46 | at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at java.net.InetAddress.getAddressesFromNameService(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at java.net.InetAddress.getLocalHost(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.util.NetUtil.getLocalHostName(NetUtil.java:41) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.sqlgenerator.core.LockDatabaseChangeLogGenerator.<clinit>(LockDatabaseChangeLogGenerator.java:28) INFO | jvm 1 | 2015/04/29 14:17:46 | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) INFO | jvm 1 | 2015/04/29 14:17:46 | at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at java.lang.reflect.Constructor.newInstance(Unknown Source) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.sqlgenerator.SqlGeneratorFactory.<init>(SqlGeneratorFactory.java:40) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.sqlgenerator.SqlGeneratorFactory.getInstance(SqlGeneratorFactory.java:54) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.AbstractExecutor.applyVisitors(AbstractExecutor.java:22) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor.access$500(JdbcExecutor.java:36) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:300) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:112) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.lockservice.StandardLockService.init(StandardLockService.java:88) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:187) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:153) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.Liquibase.update(Liquibase.java:182) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.Liquibase.update(Liquibase.java:174) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:330) INFO | jvm 1 | 2015/04/29 14:17:46 | at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:287) INFO | jvm 1 | 2015/04/29 14:17:46 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571) INFO | jvm 1 | 2015/04/29 14:17:46 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509) {code} Until I bind "160.RH6.5" to localhost (via /etc/hosts), Liquibase will crash, preventing our installed app from starting. It should have resolved "localhost" instead. I did not try newer versions of Liquibase given this part (LockDatabaseChangeLogGenerator + NetUtil) has not changed much.
    via by Florent Biville,
  • UnknownHostException kafka
    via Stack Overflow by noplay
    ,
    • java.net.UnknownHostException: CentOSNode.localdomain: CentOSNode.localdomain: Name or service not known at java.net.InetAddress.getLocalHost(Unknown Source) at org.codehaus.xfire.addressing.RandomGUID.<clinit>(RandomGUID.java:115) at org.codehaus.xfire.addressing.AddressingInHandler.<clinit>(AddressingInHandler.java:26) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.codehaus.xfire.client.CorrelatorHandler.class$(CorrelatorHandler.java:14) at org.codehaus.xfire.client.CorrelatorHandler.<init>(CorrelatorHandler.java:24) at org.codehaus.xfire.client.Client.<init>(Client.java:84) at org.codehaus.xfire.client.Client.<init>(Client.java:180) at org.codehaus.xfire.client.Client.<init>(Client.java:125) at org.codehaus.xfire.client.XFireProxyFactory.create(XFireProxyFactory.java:78) at com.soasta.common.xfire.ClientFactory.a(ClientFactory.java:139) at com.soasta.common.repository.webservice.RepositoryServiceClientFactory.getRepositoryServiceClient(RepositoryServiceClientFactory.java:51) at com.soasta.common.repository.webservice.RepositoryServiceClientFactory.getRepositoryServiceClient(RepositoryServiceClientFactory.java:41) at com.soasta.tools.scommand.commands.a.n(a.java:415) at com.soasta.tools.scommand.commands.c.c(c.java:119) at com.soasta.tools.scommand.a.a(a.java:124) at com.soasta.tools.scommand.Main.main(Main.java:25) Caused by: java.net.UnknownHostException: CentOSNode.localdomain: Name or service not known at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source) at java.net.InetAddress.getAddressesFromNameService(Unknown Source) ... 18 more

    Users with the same issue

    raj76
    2 times, last one,
    nasimk
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    60 more bugmates