解决CenOS 7下启动ActiveMQ时报错
基于 CentOS 7,ActiveMQ 5.9.1
问题重现
在 CentOS 7 下安装好ActiveMQ后,执行 /usr/local/apache-activemq-5.9.1/bin/activemq start
启动 ActiveMQ,显示:
INFO: Using default configuration
(you can configure options in one of these file: /etc/default/activemq /home/xueliang/.activemqrc)
INFO: Invoke the following command to create a configuration file
/usr/local/apache-activemq-5.9.1/bin/activemq setup [ /etc/default/activemq | /home/xueliang/.activemqrc ]
INFO: Using java '/usr/local/java/jdk1.8.0_101/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: pidfile created : '/usr/local/apache-activemq-5.9.1/data/activemq-server2.pid' (pid '24484')
从提示信息看,似乎启动成功,但根据提示信息中的 pid
查找进程时,却发现并无此进程:
ps -eLf | grep 24484
结果:
[xueliang@server2 ~]$ ps -eLf | grep 24484
xueliang 24520 23462 24520 0 1 00:52 pts/2 00:00:00 grep --color=auto 24484
[xueliang@server2 ~]$
问题原因
一个好的软件,总能在错误发生时告诉你如何解决。
执行 cat /usr/local/apache-activemq-5.9.1/data/activemq.log
看一下日志信息:
2016-10-12 02:04:09,053 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 02:04:09 CST 2016]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2016-10-12 02:04:10,498 | INFO | PListStore:[/usr/local/apache-activemq-5.9.1/data/localhost/tmp_storage] started | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main
2016-10-12 02:04:10,512 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/usr/local/apache-activemq-5.9.1/data/kahadb] | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:10,683 | INFO | KahaDB is version 5 | org.apache.activemq.store.kahadb.MessageDatabase | main
2016-10-12 02:04:10,746 | INFO | Recovering from the journal ... | org.apache.activemq.store.kahadb.MessageDatabase | main
2016-10-12 02:04:10,757 | INFO | Recovery replayed 332 operations from the journal in 0.071 seconds. | org.apache.activemq.store.kahadb.MessageDatabase | main
2016-10-12 02:04:10,955 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-35685-1476209050769-0:1) is starting | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:10,969 | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:server2-35685-1476209050769-0:1], java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Address already in use) | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:10,970 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-35685-1476209050769-0:1) is shutting down | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:10,970 | INFO | Connector openwire stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:10,970 | INFO | Connector amqp stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:10,970 | INFO | Connector stomp stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:10,970 | INFO | Connector mqtt stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:10,970 | INFO | Connector ws stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:10,973 | INFO | PListStore:[/usr/local/apache-activemq-5.9.1/data/localhost/tmp_storage] stopped | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main
2016-10-12 02:04:10,973 | INFO | Stopping async queue tasks | org.apache.activemq.store.kahadb.KahaDBStore | main
2016-10-12 02:04:10,973 | INFO | Stopping async topic tasks | org.apache.activemq.store.kahadb.KahaDBStore | main
2016-10-12 02:04:10,974 | INFO | Stopped KahaDB | org.apache.activemq.store.kahadb.KahaDBStore | main
2016-10-12 02:04:11,193 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-35685-1476209050769-0:1) uptime 0.691 seconds | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:11,193 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-35685-1476209050769-0:1) is shutdown | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:11,193 | INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 02:04:09 CST 2016]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2016-10-12 02:04:11,194 | WARN | Exception thrown from LifecycleProcessor on context close | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 02:04:09 CST 2016]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
at org.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30)
at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:809)
at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:601)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)
at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
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.runTask(StartCommand.java:87)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
at org.apache.activemq.console.Main.main(Main.java:115)
2016-10-12 02:04:30,534 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 02:04:30 CST 2016]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2016-10-12 02:04:31,297 | INFO | PListStore:[/usr/local/apache-activemq-5.9.1/data/localhost/tmp_storage] started | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main
2016-10-12 02:04:31,311 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/usr/local/apache-activemq-5.9.1/data/kahadb] | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:31,472 | INFO | KahaDB is version 5 | org.apache.activemq.store.kahadb.MessageDatabase | main
2016-10-12 02:04:31,530 | INFO | Recovering from the journal ... | org.apache.activemq.store.kahadb.MessageDatabase | main
2016-10-12 02:04:31,543 | INFO | Recovery replayed 334 operations from the journal in 0.068 seconds. | org.apache.activemq.store.kahadb.MessageDatabase | main
2016-10-12 02:04:31,680 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-52293-1476209071560-0:1) is starting | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:31,695 | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:server2-52293-1476209071560-0:1], java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Address already in use) | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:31,695 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-52293-1476209071560-0:1) is shutting down | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:31,696 | INFO | Connector openwire stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:31,696 | INFO | Connector amqp stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:31,696 | INFO | Connector stomp stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:31,696 | INFO | Connector mqtt stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:31,696 | INFO | Connector ws stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:04:31,699 | INFO | PListStore:[/usr/local/apache-activemq-5.9.1/data/localhost/tmp_storage] stopped | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main
2016-10-12 02:04:31,699 | INFO | Stopping async queue tasks | org.apache.activemq.store.kahadb.KahaDBStore | main
2016-10-12 02:04:31,699 | INFO | Stopping async topic tasks | org.apache.activemq.store.kahadb.KahaDBStore | main
2016-10-12 02:04:31,700 | INFO | Stopped KahaDB | org.apache.activemq.store.kahadb.KahaDBStore | main
2016-10-12 02:04:31,984 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-52293-1476209071560-0:1) uptime 0.682 seconds | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:31,984 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-52293-1476209071560-0:1) is shutdown | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:04:31,984 | INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 02:04:30 CST 2016]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2016-10-12 02:04:31,985 | WARN | Exception thrown from LifecycleProcessor on context close | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 02:04:30 CST 2016]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
at org.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30)
at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:809)
at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:601)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)
at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
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.runTask(StartCommand.java:87)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
at org.apache.activemq.console.Main.main(Main.java:115)
2016-10-12 02:07:32,656 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 02:07:32 CST 2016]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2016-10-12 02:07:33,326 | INFO | PListStore:[/usr/local/apache-activemq-5.9.1/data/localhost/tmp_storage] started | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main
2016-10-12 02:07:33,343 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/usr/local/apache-activemq-5.9.1/data/kahadb] | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:07:33,528 | INFO | KahaDB is version 5 | org.apache.activemq.store.kahadb.MessageDatabase | main
2016-10-12 02:07:33,587 | INFO | Recovering from the journal ... | org.apache.activemq.store.kahadb.MessageDatabase | main
2016-10-12 02:07:33,602 | INFO | Recovery replayed 336 operations from the journal in 0.071 seconds. | org.apache.activemq.store.kahadb.MessageDatabase | main
2016-10-12 02:07:33,740 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-53098-1476209253622-0:1) is starting | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:07:33,749 | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:server2-53098-1476209253622-0:1], java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Address already in use) | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:07:33,750 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-53098-1476209253622-0:1) is shutting down | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:07:33,750 | INFO | Connector openwire stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:07:33,750 | INFO | Connector amqp stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:07:33,750 | INFO | Connector stomp stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:07:33,750 | INFO | Connector mqtt stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:07:33,750 | INFO | Connector ws stopped | org.apache.activemq.broker.TransportConnector | main
2016-10-12 02:07:33,752 | INFO | PListStore:[/usr/local/apache-activemq-5.9.1/data/localhost/tmp_storage] stopped | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main
2016-10-12 02:07:33,753 | INFO | Stopping async queue tasks | org.apache.activemq.store.kahadb.KahaDBStore | main
2016-10-12 02:07:33,753 | INFO | Stopping async topic tasks | org.apache.activemq.store.kahadb.KahaDBStore | main
2016-10-12 02:07:33,753 | INFO | Stopped KahaDB | org.apache.activemq.store.kahadb.KahaDBStore | main
2016-10-12 02:07:34,039 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-53098-1476209253622-0:1) uptime 0.710 seconds | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:07:34,039 | INFO | Apache ActiveMQ 5.9.1 (localhost, ID:server2-53098-1476209253622-0:1) is shutdown | org.apache.activemq.broker.BrokerService | main
2016-10-12 02:07:34,040 | INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 02:07:32 CST 2016]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2016-10-12 02:07:34,041 | WARN | Exception thrown from LifecycleProcessor on context close | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 02:07:32 CST 2016]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
at org.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30)
at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:809)
at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:601)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)
at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
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.runTask(StartCommand.java:87)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
at org.apache.activemq.console.Main.main(Main.java:115)
刚开始把精力留在了最后一个 WARN
处,即:
2016-10-12 01:08:54,001 | WARN | Exception thrown from LifecycleProcessor on context close | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.apache.activemq.xbean.XBeanBrokerFactory$1@13c78c0b: startup date [Wed Oct 12 01:08:52 CST 2016]; root of context hierarchy
Google 了很久,问题并没有解决,其实问题在上面第一个 ERROR
处,即:
2016-10-12 01:08:53,602 | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:server2-43498-1476205733474-0:1], java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Address already in use) | org.apache.activemq.broker.BrokerService | main
从提示信息中的 due to: java.net.BindException: Address already in use
可以看到是端口 61616
被占用了。
解决方案
既然问题找到了,也就知道怎么解决。
使用 netstat -anp | grep 61616
查看是哪个程序占用了 61616
端口:
[xueliang@server2 ~]$ netstat -anp | grep 61616
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::61616 ::解决CenOS 7下启动ActiveMQ时报错的更多相关文章
- Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with
Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with 摘要 Li ...
- 用Eclipse的tomcat插件启动tomcat时报错:
用Eclipse的tomcat插件启动tomcat时报错: FATAL ERROR in native method: JDWP No transports initialized, jvmtiErr ...
- 【转】Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.
转载地址:http://blog.csdn.net/jnqqls/article/details/8946964 1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动to ...
- MyEclipse 启动tomcat时报错:Cannot change deployment state from ERROR to REDEPLOYING.ds
myeclipse 启动tomcat时报错:Cannot change deployment state from ERROR to REDEPLOYING.ds - 刘琦的专栏 - 博客频道 - C ...
- 【原创】大叔经验分享(57)hue启动coordinator时报错
hue启动coordinator时报错,页面返回undefinied错误框: 后台日志报错: runcpserver.log [13/May/2019 04:34:55 -0700] middlewa ...
- vmware启动winodws时报错弹出【无法连接MKS:套接字连接尝试次数太多;正在放弃;】
启动虚拟机时报错 解决办法:(其实就是有关于虚拟机的服务没有起) win+R输入services.msc,将所有有关vmware的服务都起起来即可
- Windows下启动Solr报错:Nothing to start,exiting...
如果用java -jar start.jar命令启动Solr时报错:Nothing to start,exiting...,可尝试: 百度jetty,上官网下载压缩包并解压(下载页面地址:http:/ ...
- 启动outlook时报错:mapi无法加载信息服务msncon.dll
今天这个Office2010 outlook搞的让人蛋疼,老是说启动outlook时报错:mapi无法加载信息服务msncon.dll. 百度了一下,如下解决方案: 安装路径为D:\NEW Windo ...
- Windows下启动ActiveMq端口被占用的解决办法
cd /D E:\RuntimeSoft\apache-activemq-5.11.0\binactivemq.bat start结果提示:端口号被占用. Windows下查看端口号被占用开始--运行 ...
随机推荐
- 简述Android系统内存不足时候,内存回收机制
当Android系统的内存不足时,会根据以下的内存回收规则来回收内存: 1.先回收与其他Activity或Service/Intent Receiver无关的进程(即优先回收独立的Activity) ...
- Ubuntu 安装wireshark
参考:ubuntu下安装wireshark 依赖及相关包的安装 1.编译工具 apt-get install build-essential 2.GTK+的开发文件和GLib库(libraries) ...
- HDU-1994-利息计算
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1994 水题 题目分析 就是两种储存方式,输出所得本金加利息 代码 #include<stdio. ...
- TIMESTAMP和DATETIME哪个好
日期范围 TIMESTAMP 支持从'1970-01-01 00:00:01′ 到 '2038-01-19 03:14:07′ UTC. 这个时间可能对目前正在工作的人来说没什么问题,可以坚持到我们退 ...
- iOS oc和swift中协议的使用
创建一个空的工程 在工程中我们新建一个类 继承与NSObject 定义一个协议‘ @protocol UpdateAlertDelegate <NSObject> //这里的红色字体就是我 ...
- c#使用DotNetZip封装类操作zip文件(创建/读取/更新)实例
DotnetZip是一个开源类库,支持.NET的任何语言,可很方便的创建,读取,和更新zip文件.而且还可以使用在.NETCompact Framework中. 下载地址在这里:http://dot ...
- WPF实现多值绑定特性以及多值转换
WPF中的实现 我们首先来看一下常规的绑定 <Window x:Class="WpfApplicationSample.MainWindow" xmlns=&qu ...
- Android项目中打jar包 和 使用
第一步,把普通的android project设置成库项目 库项目也是一个标准的android项目,因此你先创建一个普通的android项目. 这个项目可以起任何的名称,任何的报名,设置其他需要设置的 ...
- ListView 的三种数据绑定方式
ListView 的三种数据绑定方式 1.最原始的绑定方式: public ObservableCollection<object> ObservableObj; public Mai ...
- 在Express中安装XTemplate
上一节讲了安装Express,并且生成了一个"microblog"的工程,我们的目标是在工程下安装XTemplate: 1.安装xtpl npm install xtpl xtem ...