再访问控制页面的时候已经抛500内部错误了,截图如下:
此时ActiveMQ再也无法启动了,据说是由于使用了内存存储方式导致的。然后修改存储方式为文件存储(fileQueueCursor)再启动悲剧又发生了:
INFO | cursor for queue://thumb has recovered 11700000 messages. 75% complete
Exception in thread "Queue:test" Exception in thread "ActiveMQ Broker[zom-mq-jn-03] Scheduler" java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.apache.activemq.broker.region.Queue.doPageInForDispatch(Queue.java:1753)
at org.apache.activemq.broker.region.Queue.pageInMessages(Queue.java:1932)
at org.apache.activemq.broker.region.Queue.doBrowse(Queue.java:987)
at org.apache.activemq.broker.region.Queue.expireMessages(Queue.java:785)
at org.apache.activemq.broker.region.Queue.access$100(Queue.java:84)
at org.apache.activemq.broker.region.Queue$2.run(Queue.java:124)
at org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Exception in thread "KahaDB Scheduler" java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.HashMap.newValueIterator(HashMap.java:843)
at java.util.HashMap$Values.iterator(HashMap.java:910)
at org.apache.kahadb.journal.DataFileAccessorPool.disposeUnused(DataFileAccessorPool.java:105)
at org.apache.kahadb.journal.Journal.cleanup(Journal.java:387)
at org.apache.kahadb.journal.Journal$2.run(Journal.java:184)
at org.apache.kahadb.util.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path resource [activemq.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path resource [activemq.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:143)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
at org.apache.activemq.console.Main.main(Main.java:107)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path resource [activemq.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.
at org.apache.activemq.xbean.XBeanBrokerFactory$1.
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:114)
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:70)
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.startBroker(StartCommand.java:115)
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
... 10 more
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.apache.activemq.command.MessageId.
at org.apache.activemq.openwire.v6.MessageIdMarshaller.createObject(MessageIdMarshaller.java:55)
at org.apache.activemq.openwire.OpenWireFormat.looseUnmarshalNestedObject(OpenWireFormat.java:470)
at org.apache.activemq.openwire.v6.BaseDataStreamMarshaller.looseUnmarsalNestedObject(BaseDataStreamMarshaller.java:467)
at org.apache.activemq.openwire.v6.MessageMarshaller.looseUnmarshal(MessageMarshaller.java:217)
at org.apache.activemq.openwire.v6.ActiveMQMessageMarshaller.looseUnmarshal(ActiveMQMessageMarshaller.java:101)
at org.apache.activemq.openwire.v6.ActiveMQTextMessageMarshaller.looseUnmarshal(ActiveMQTextMessageMarshaller.java:101)
at org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:364)
at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:276)
at org.apache.activemq.store.kahadb.KahaDBStore.loadMessage(KahaDBStore.java:956)
at org.apache.activemq.store.kahadb.KahaDBStore$KahaDBMessageStore$4.execute(KahaDBStore.java:471)
at org.apache.kahadb.page.Transaction.execute(Transaction.java:728)
at org.apache.activemq.store.kahadb.KahaDBStore$KahaDBMessageStore.recover(KahaDBStore.java:464)
at org.apache.activemq.store.ProxyMessageStore.recover(ProxyMessageStore.java:52)
at org.apache.activemq.broker.region.Queue.initialize(Queue.java:270)
at org.apache.activemq.broker.region.DestinationFactoryImpl.createDestination(DestinationFactoryImpl.java:86)
at org.apache.activemq.broker.region.AbstractRegion.createDestination(AbstractRegion.java:473)
at org.apache.activemq.broker.jmx.ManagedQueueRegion.createDestination(ManagedQueueRegion.java:56)
at org.apache.activemq.broker.region.AbstractRegion.addDestination(AbstractRegion.java:123)
at org.apache.activemq.broker.region.RegionBroker.addDestination(RegionBroker.java:298)
at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:145)
at org.apache.activemq.advisory.AdvisoryBroker.addDestination(AdvisoryBroker.java:145)
at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:145)
at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:145)
at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:145)
at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:145)
at org.apache.activemq.security.AuthorizationBroker.addDestination(AuthorizationBroker.java:81)
at org.apache.activemq.broker.MutableBrokerFilter.addDestination(MutableBrokerFilter.java:151)
at org.apache.activemq.broker.region.AbstractRegion.start(AbstractRegion.java:95)
at org.apache.activemq.broker.region.RegionBroker.start(RegionBroker.java:198)
at org.apache.activemq.broker.jmx.ManagedRegionBroker.start(ManagedRegionBroker.java:106)
at org.apache.activemq.broker.BrokerFilter.start(BrokerFilter.java:157)
算了,明日就放假了。没时间折腾它了,用一个简单而稳妥的办法:“监控ActiveMQ的队列数量,入队数达到一定数量后停顿。”
转载:http://hi.baidu.com/higkoo/item/7d35b5339012eec31b9696fe