在按照 《ActiveMQ in Action》的操作步驟進行操作的時候,ActiveMQ異常終止后,總是不能啟動,總是在報錯誤。
2012-03-14 14:45:13,552 | ERROR | Failed to start ActiveMQ JMS Message Broker. Reason: java.io.EOFException: Chunk stream does not exist at page: 0 | org.apache.activemq.broker.BrokerService | main
java.io.EOFException: Chunk stream does not exist at page: 0
at org.apache.kahadb.page.Transaction$2.readPage(Transaction.java:454)
at org.apache.kahadb.page.Transaction$2.<init>(Transaction.java:431)
at org.apache.kahadb.page.Transaction.openInputStream(Transaction.java:428)
at org.apache.kahadb.page.Transaction.load(Transaction.java:404)
at org.apache.kahadb.page.Transaction.load(Transaction.java:361)
at org.apache.activemq.broker.scheduler.JobSchedulerStore$3.execute(JobSchedulerStore.java:250)
at org.apache.kahadb.page.Transaction.execute(Transaction.java:728)
at org.apache.activemq.broker.scheduler.JobSchedulerStore.doStart(JobSchedulerStore.java:239)
at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
at org.apache.activemq.broker.scheduler.SchedulerBroker.getStore(SchedulerBroker.java:198)
at org.apache.activemq.broker.scheduler.SchedulerBroker.getInternalScheduler(SchedulerBroker.java:185)
at org.apache.activemq.broker.scheduler.SchedulerBroker.start(SchedulerBroker.java:85)
java.io.EOFException: Chunk stream does not exist at page: 0
at org.apache.kahadb.page.Transaction$2.readPage(Transaction.java:454)
at org.apache.kahadb.page.Transaction$2.<init>(Transaction.java:431)
at org.apache.kahadb.page.Transaction.openInputStream(Transaction.java:428)
at org.apache.kahadb.page.Transaction.load(Transaction.java:404)
at org.apache.kahadb.page.Transaction.load(Transaction.java:361)
at org.apache.activemq.broker.scheduler.JobSchedulerStore$3.execute(JobSchedulerStore.java:250)
at org.apache.kahadb.page.Transaction.execute(Transaction.java:728)
at org.apache.activemq.broker.scheduler.JobSchedulerStore.doStart(JobSchedulerStore.java:239)
at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
at org.apache.activemq.broker.scheduler.SchedulerBroker.getStore(SchedulerBroker.java:198)
at org.apache.activemq.broker.scheduler.SchedulerBroker.getInternalScheduler(SchedulerBroker.java:185)
at org.apache.activemq.broker.scheduler.SchedulerBroker.start(SchedulerBroker.java:85)
經過搜索了之后,悲催的發現這個是ActiveMQ5.4.1的一個bug。在5.5里面給解決了。
its a known bug and fixed in current trunk (5.5-SNAPSHOT).
https://issues.apache.org/jira/browse/AMQ-2935
但是為了避免在學習的過程中,因為版本不匹配等原因產生問題,於是繼續搜索,終於找到了解決辦法。主要是由於 5.4.1 這個版本引入延遲發送的功能引起的, 解決辦法是在<broker>中添加 schedulerSupport="false" 屬性,禁掉scheduler功能。
參照文章http://blog.csdn.net/technofantasy/article/details/6037295
代碼
<
broker
xmlns
="http://activemq.apache.org/schema/core "
brokerName
="SIBBusModule-TestDeCharge-td0sib01s"
useJmx
="true"
persistent
="false"
useShutdownHook
="false"
schedulerSupport
="false"
>
還有就是刪除activemq目錄下的data/xxxx/scheduler 下的所有內容,不過這種我沒有嘗試