你好,游客 登录 注册 搜索
背景:
阅读新闻

CentOS 6.5启动ActiveMQ报错解决

[日期:2015-08-01] 来源:Linux社区  作者:mohan87821000 [字体: ]

根据公司的实际需要,进行公司系统架构的迁移,在迁移过程中,遇到了一个很奇葩的问题:CentOS 6.5下启动ActiveMQ时报错,具体信息如下:

2015-07-27 18:00:43,922 | 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@6276ae34: startup date [Mon Jul 27 18:00:39 EDT 2015]; root of context hierarchy

at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30)[activemq-spring-5.10.0.jar:5.10.0]

at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:809)[activemq-broker-5.10.0.jar:5.10.0]

at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122)[activemq-spring-5.10.0.jar:5.10.0]

at org.apache.activemq.broker.BrokerService.start(BrokerService.java:601)[activemq-broker-5.10.0.jar:5.10.0]

at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)[activemq-spring-5.10.0.jar:5.10.0]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_05]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_05]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_05]

at java.lang.reflect.Method.invoke(Method.java:483)[:1.8.0_05]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-3.16.jar:3.16]

at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-3.16.jar:3.16]

at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.10.0.jar:5.10.0]

at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.10.0.jar:5.10.0]

at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.10.0.jar:5.10.0]

at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.10.0.jar:5.10.0]

at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.10.0.jar:5.10.0]

at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.10.0.jar:5.10.0]

at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.10.0.jar:5.10.0]

at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)[activemq-console-5.10.0.jar:5.10.0]

at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.10.0.jar:5.10.0]

at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.10.0.jar:5.10.0]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_05]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_05]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_05]

at java.lang.reflect.Method.invoke(Method.java:483)[:1.8.0_05]

at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.10.0]

at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.10.0]
 

排查问题思路:首先从log着手

说明:我的mq的安装目录为:/data/mq_server,所以log的位置在:/data/mq_server/apache-activemq-5.10.0/data目录下,直接使用tail -f activemq.log实时查看log的输出,从而判断问题

输出的日志中有“java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: ”

百度搜索了一下,找到了痴线此问题的原因:主机名(tomcat_server)中有下划线,不能识别

再次启动activemq服务:/data/mq_server/apache-activemq-5.10.0/bin//activemq start

2015-07-27 18:09:49,273 | INFO  | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@6276ae34: startup date [Mon Jul 27 18:09:49 EDT 2015]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main

2015-07-27 18:09:51,121 | INFO  | PListStore:[/data/mq_server/apache-activemq-5.10.0/data/localhost/tmp_storage] started | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main

2015-07-27 18:09:51,161 | INFO  | Using Persistence Adapter: KahaDBPersistenceAdapter[/data/mq_server/apache-activemq-5.10.0/data/kahadb] | org.apache.activemq.broker.BrokerService | main

2015-07-27 18:09:52,602 | INFO  | KahaDB is version 5 | org.apache.activemq.store.kahadb.MessageDatabase | main

2015-07-27 18:09:52,634 | INFO  | Recovering from the journal ... | org.apache.activemq.store.kahadb.MessageDatabase | main

2015-07-27 18:09:52,637 | INFO  | Recovery replayed 1 operations from the journal in 0.022 seconds. | org.apache.activemq.store.kahadb.MessageDatabase | main

2015-07-27 18:09:52,808 | INFO  | Apache ActiveMQ 5.10.0 (localhost, ID:tomcat-server-52376-1438034992673-0:1) is starting | org.apache.activemq.broker.BrokerService | main

2015-07-27 18:09:53,103 | INFO  | Listening for connections at: tcp://tomcat-server:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main

2015-07-27 18:09:53,115 | INFO  | Connector openwire started | org.apache.activemq.broker.TransportConnector | main

2015-07-27 18:09:53,133 | INFO  | Listening for connections at: amqp://tomcat-server:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main

2015-07-27 18:09:53,144 | INFO  | Connector amqp started | org.apache.activemq.broker.TransportConnector | main

2015-07-27 18:09:53,159 | INFO  | Listening for connections at: stomp://tomcat-server:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main

2015-07-27 18:09:53,168 | INFO  | Connector stomp started | org.apache.activemq.broker.TransportConnector | main

2015-07-27 18:09:53,184 | INFO  | Listening for connections at: mqtt://tomcat-server:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main

2015-07-27 18:09:53,193 | INFO  | Connector mqtt started | org.apache.activemq.broker.TransportConnector | main

2015-07-27 18:09:53,601 | INFO  | Listening for connections at ws://tomcat-server:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.ws.WSTransportServer | main

2015-07-27 18:09:53,603 | INFO  | Connector ws started | org.apache.activemq.broker.TransportConnector | main

2015-07-27 18:09:53,619 | INFO  | Apache ActiveMQ 5.10.0 (localhost, ID:tomcat-server-52376-1438034992673-0:1) started | org.apache.activemq.broker.BrokerService | main

2015-07-27 18:09:53,624 | INFO  | For help or more information please see: http://activemq.apache.org | org.apache.activemq.broker.BrokerService | main

2015-07-27 18:09:53,629 | WARN  | Store limit is 102400 mb (current store usage is 14 mb). The data directory: /data/mq_server/apache-activemq-5.10.0/data/kahadb only has 69426 mb of usable space - resetting to maximum available disk space: 69441 mb | org.apache.activemq.broker.BrokerService | main

2015-07-27 18:09:54,893 | INFO  | ActiveMQ WebConsole available at http://0.0.0.0:8161/ | org.apache.activemq.web.WebConsoleStarter | main

2015-07-27 18:09:55,037 | INFO  | Initializing Spring FrameworkServlet 'dispatcher' | /admin | main

2015-07-27 18:09:55,549 | INFO  | jolokia-agent: No access restrictor found at classpath:/jolokia-access.xml, access to all MBeans is allowed | /api | main

Linux系统下ActiveMQ 安装 http://www.linuxidc.com/Linux/2012-03/55623.htm

Ubuntu下的ACTIVEMQ服务器 http://www.linuxidc.com/Linux/2008-07/14587.htm

Spring+JMS+ActiveMQ+Tomcat实现消息服务 http://www.linuxidc.com/Linux/2011-10/44632.htm

Linux环境下面ActiveMQ端口号设置和WEB端口号设置 http://www.linuxidc.com/Linux/2012-01/51100.htm

ActiveMQ5.11.1和JDK版本的匹配关系   http://www.linuxidc.com/Linux/2015-05/118124.htm

更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

本文永久更新链接地址http://www.linuxidc.com/Linux/2015-08/120898.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款