阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS 6.5启动ActiveMQ报错解决

216次阅读
没有评论

共计 10161 个字符,预计需要花费 26 分钟才能阅读完成。

根据公司的实际需要,进行公司系统架构的迁移,在迁移过程中,遇到了一个很奇葩的问题: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

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计10161字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中