Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-2965

ActiveMQ fails to start if no DNS resolution for hostname is available

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.3.0, 5.3.1, 5.3.2, 5.4.0, 5.4.1
    • 5.4.2
    • Broker
    • None

    Description

      ActiveMQ is installed on a physical server with two ethernet interfaces – the first is a 10.x.x.x network and used only for external traffic , the second interface is a 172.x.x.x network and is used only for internal (intra-cluster node) communication. ActiveMQ is configured to listen only on the 172.x.x.x interface. External DNS resolution exists but internal DNS resolution does not. While each host has a unique name, none of these names are resolvable. Under these circumstances, ActiveMQ fails to start up successfully. Below are the exceptions and stack trace:

      2010-06-09 16:48:45,714 | ERROR | Failed to resolve localhost | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-06-09 16:48:46,092 | INFO | Using Persistence Adapter: org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter@47c297a3 | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-06-09 16:48:46,928 | INFO | JMX consoles can connect to service:jmx:rmi://localhost:11616/jndi/rmi://localhost:1616/jmxrmi | org.apache.activemq.broker.jmx.ManagementContext | JMX connector
      2010-06-09 16:48:47,036 | INFO | ActiveMQ 5.3.2 JMS Message Broker (Q01M0003) is starting | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-06-09 16:48:47,036 | INFO | For help or more information please see: http://activemq.apache.org/ | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-06-09 16:48:47,280 | WARN | could not generate unique stub | org.apache.activemq.util.IdGenerator | WrapperSimpleAppMain
      java.net.UnknownHostException: Q01M0003: Q01M0003
      at java.net.InetAddress.getLocalHost(Unknown Source)
      at org.apache.activemq.util.IdGenerator.<clinit>(IdGenerator.java:52)
      at org.apache.activemq.broker.region.RegionBroker.<clinit>(RegionBroker.java:75)
      at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1734)
      at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1728)
      at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1688)
      at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:706)
      at org.apache.activemq.broker.BrokerService.start(BrokerService.java:469)
      at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:85)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
      at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
      at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
      at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
      at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
      at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
      at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:136)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:82)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
      at org.apache.activemq.console.Main.main(Main.java:107)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
      at java.lang.Thread.run(Unknown Source)
      2010-06-09 16:48:47,407 | ERROR | Failed to start ActiveMQ JMS Message Broker. Reason: java.io.IOException: Transport Connector could not be registered in JMX: Q01M0003: Q01M0003 | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      java.io.IOException: Transport Connector could not be registered in JMX: Q01M0003: Q01M0003
      at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
      at org.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:1585)
      at org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:2006)
      at org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:1959)
      at org.apache.activemq.broker.BrokerService.start(BrokerService.java:491)
      at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:85)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
      at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
      at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
      at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
      at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
      at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
      at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:136)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:82)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
      at org.apache.activemq.console.Main.main(Main.java:107)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.net.UnknownHostException: Q01M0003: Q01M0003
      at java.net.InetAddress.getLocalHost(Unknown Source)
      at org.apache.activemq.transport.tcp.TcpTransportServer.resolveHostName(TcpTransportServer.java:336)
      at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:142)
      at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:60)
      at org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:131)
      at org.apache.activemq.broker.TransportConnector.createTransportServer(TransportConnector.java:305)
      at org.apache.activemq.broker.TransportConnector.getServer(TransportConnector.java:137)
      at org.apache.activemq.broker.TransportConnector.asManagedConnector(TransportConnector.java:100)
      at org.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:1580)
      ... 47 more
      2010-06-09 16:48:47,409 | INFO | ActiveMQ Message Broker (Q01M0003, null) is shutting down | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-06-09 16:48:47,410 | INFO | Connector openwire Stopped | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
      2010-06-09 16:48:47,535 | INFO | ActiveMQ JMS Message Broker (Q01M0003, null) stopped | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain

      This problem can be worked around by adding an entry to the /etc/hosts file for each machine. Unfortunately this presents quite a maintenance nightmare in a very large environment.

      Attachments

        1. AMQ-2965-patch.txt
          8 kB
          Bruce Snyder

        Activity

          People

            bsnyder Bruce Snyder
            bsnyder Bruce Snyder
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: