今天安装ActiveMQ之后,无法运行ActiveMQ。打开日志后发现报错从网上查出,是由于hostname中含有下划线所致,但服务器hostname中并没有设置下划线,到是有'.'。于是就改'.'为'-'后运行成功
错误如下:
2017-01-05 17:18:18,628 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@617746b2: startup date [Thu Jan 05 17:18:18 CST 2017]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | WrapperSimpleAppMain
2017-01-05 17:18:20,658 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/usr/local/apache-activemq-5.14.3/bin/linux-x86-64/../../data/kahadb] | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
2017-01-05 17:18:21,229 | INFO | PListStore:[/usr/local/apache-activemq-5.14.3/bin/linux-x86-64/../../data/localhost/tmp_storage] started | org.apache.activemq.store.kahadb.plist.PListStoreImpl | WrapperSimpleAppMain
2017-01-05 17:18:21,408 | INFO | Apache ActiveMQ 5.14.3 (localhost, ID:ERP-APP1-80.101-64742-1483607901254-0:1) is starting | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
2017-01-05 17:18:21,456 | INFO | Listening for connections at: tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | WrapperSimpleAppMain
2017-01-05 17:18:21,464 | INFO | Connector openwire started | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
2017-01-05 17:18:21,476 | INFO | Listening for connections at: amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | WrapperSimpleAppMain
2017-01-05 17:18:21,484 | INFO | Connector amqp started | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
2017-01-05 17:18:21,496 | INFO | Listening for connections at: stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | WrapperSimpleAppMain
2017-01-05 17:18:21,505 | INFO | Connector stomp started | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
2017-01-05 17:18:21,516 | INFO | Listening for connections at: mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | WrapperSimpleAppMain
2017-01-05 17:18:21,523 | INFO | Connector mqtt started | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
2017-01-05 17:18:21,625 | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:ERP-APP1-80.101-64742-1483607901254-0:1], java.net.URISyntaxException: Illegal character in hostname at index 17: ws://ERP-APP1-80.101:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600) | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
2017-01-05 17:18:21,632 | INFO | Apache ActiveMQ 5.14.3 (localhost, ID:ERP-APP1-80.101-64742-1483607901254-0:1) is shutting down | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
2017-01-05 17:18:21,638 | INFO | Connector openwire stopped | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
2017-01-05 17:18:21,645 | INFO | Connector amqp stopped | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
2017-01-05 17:18:21,648 | INFO | Connector stomp stopped | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
2017-01-05 17:18:21,653 | INFO | Connector mqtt stopped | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
2017-01-05 17:18:21,653 | INFO | socketQueue interrupted - stopping | org.apache.activemq.transport.tcp.TcpTransportServer | ActiveMQ Transport Server Thread Handler: mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600
2017-01-05 17:18:21,655 | INFO | Connector ws stopped | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
2017-01-05 17:18:21,658 | INFO | Could not accept connection during shutdown : java.lang.InterruptedException | org.apache.activemq.broker.TransportConnector | ActiveMQ Transport Server Thread Handler: mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600
2017-01-05 17:18:21,664 | INFO | PListStore:[/usr/local/apache-activemq-5.14.3/bin/linux-x86-64/../../data/localhost/tmp_storage] stopped | org.apache.activemq.store.kahadb.plist.PListStoreImpl | WrapperSimpleAppMain
2017-01-05 17:18:21,665 | INFO | Stopping async queue tasks | org.apache.activemq.store.kahadb.KahaDBStore | WrapperSimpleAppMain
2017-01-05 17:18:21,667 | INFO | Stopping async topic tasks | org.apache.activemq.store.kahadb.KahaDBStore | WrapperSimpleAppMain
2017-01-05 17:18:21,669 | INFO | Stopped KahaDB | org.apache.activemq.store.kahadb.KahaDBStore | WrapperSimpleAppMain
2017-01-05 17:18:21,720 | INFO | Apache ActiveMQ 5.14.3 (localhost, ID:ERP-APP1-80.101-64742-1483607901254-0:1) uptime 1.104 seconds | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
2017-01-05 17:18:21,722 | INFO | Apache ActiveMQ 5.14.3 (localhost, ID:ERP-APP1-80.101-64742-1483607901254-0:1) is shutdown | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
2017-01-05 17:18:21,723 | INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1@617746b2: startup date [Thu Jan 05 17:18:18 CST 2017]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | WrapperSimpleAppMain
2017-01-05 17:18:21,728 | WARN | Exception thrown from LifecycleProcessor on context close | org.apache.activemq.xbean.XBeanBrokerFactory$1 | WrapperSimpleAppMain
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.apache.activemq.xbean.XBeanBrokerFactory$1@617746b2: startup date [Thu Jan 05 17:18:18 CST 2017]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:357)[spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:884)[spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:843)[spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30)[activemq-spring-5.14.3.jar:5.14.3]
at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:875)[activemq-broker-5.14.3.jar:5.14.3]
at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122)[activemq-spring-5.14.3.jar:5.14.3]
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:629)[activemq-broker-5.14.3.jar:5.14.3]
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)[activemq-spring-5.14.3.jar:5.14.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_45]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1700)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1639)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)[spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)[spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-4.2.jar:4.2]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-4.2.jar:4.2]
at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.14.3.jar:5.14.3]
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.14.3.jar:5.14.3]
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.14.3.jar:5.14.3]
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.14.3.jar:5.14.3]
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.14.3.jar:5.14.3]
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.14.3.jar:5.14.3]
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.14.3.jar:5.14.3]
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)[activemq-console-5.14.3.jar:5.14.3]
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.14.3.jar:5.14.3]
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.14.3.jar:5.14.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_45]
at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.14.3]
at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.14.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_45]
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)[wrapper.jar:3.2.3]
at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]