activemq启动不成功又一例
最近真是跟activemq杠上了,今天发现又不能启动成功,然后找到以下解决办法:
Illegalcharacterinhostnameerroronhostswithunderscoresintheirhostnames
---------------------------------------------------------------------------------
Key:AMQ-1188
URL:https://issues.apache.org/activemq/browse/AMQ-1188
Project:ActiveMQ
IssueType:Bug
AffectsVersions:4.1.0
Environment:RHEL4Update4ESx86_64
SunJDK1.4.2_08
Reporter:YanikGrignon
Priority:Minor
Onamachinewherethehostnamecontainsunderscores(e.g.HS_RH64_A3_1)ActiveMQfailstoinitializewiththestacktracebelow.ThisseemstobeaproblemwiththeTCPprotocolhandlersincedoingnewURL("<ahref="http://HS_RH64_A3_1.godzilla.local:61616""added>http://HS_RH64_A3_1.godzilla.local:61616")worksfine.
2007-03-0508:30:20,076[WrapperSimpleAppMain]ERROR(BrokerService.java:412)-FailedtostartActiveMQJMSMessageBroker.Reason:java.io.IOException:Transp
ortConnectorcouldnotberegisteredinJMX:Illegalcharacterinhostnameatindex8:tcp://HS_RH64_A3_1.godzilla.local:61616
java.io.IOException:TransportConnectorcouldnotberegisteredinJMX:Illegalcharacterinhostnameatindex8:tcp://HS_RH64_A3_1.godzilla.local:61616
atorg.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:25)
atorg.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:1079)
atorg.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:1508)
atorg.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:1468)
atorg.apache.activemq.broker.BrokerService.start(BrokerService.java:402)
atorg.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:47)
atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1062)
atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)
atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:420)
atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290)
atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
atorg.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:161)
atorg.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:51)
atorg.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:41)
atorg.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:57)
atorg.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:82)
atorg.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:47)
atorg.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:50)
atorg.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:82)
atorg.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:50)
atorg.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:46)
atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
atjava.lang.reflect.Method.invoke(Method.java:585)
atorg.apache.activemq.console.Main.runTaskClass(Main.java:159)
atorg.apache.activemq.console.Main.main(Main.java:91)
atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
atjava.lang.reflect.Method.invoke(Method.java:585)
atorg.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:197)
atjava.lang.Thread.run(Thread.java:595)
Causedby:java.io.IOException:Illegalcharacterinhostnameatindex8:tcp://HS_RH64_A3_1.godzilla.local:61616
atorg.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:43)
atorg.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:94)
atorg.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:56)
atorg.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:109)
atorg.apache.activemq.broker.TransportConnector.createTransportServer(TransportConnector.java:270)
atorg.apache.activemq.broker.TransportConnector.getServer(TransportConnector.java:122)
atorg.apache.activemq.broker.TransportConnector.asManagedConnector(TransportConnector.java:100)
atorg.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:1072)
...35more
Causedby:java.net.URISyntaxException:Illegalcharacterinhostnameatindex8:tcp://HS_RH64_A3_1.godzilla.local:61616
atjava.net.URI$Parser.fail(URI.java:2816)
atjava.net.URI$Parser.parseHostname(URI.java:3355)
atjava.net.URI$Parser.parseServer(URI.java:3204)
atjava.net.URI$Parser.parseAuthority(URI.java:3123)
atjava.net.URI$Parser.parseHierarchical(URI.java:3065)
atjava.net.URI$Parser.parse(URI.java:3021)
atjava.net.URI.<init>(URI.java:663)
atorg.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:91)
...41more
FWIW a workaround is probably to use the IP address in the config file (its only when using the localhost that we try and resolve it). I've added a fix to trunk to work around this where if the URI is invalid we try to use the IP address in the URI instead. Let us know if that doesn't fix it and we can reopen this issue