activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qbeukes <qbeu...@add.za.net>
Subject Re: Urgent java.lang.IndexOutOfBoundsException in ActiveMQ Kaha Storage - Data lost?
Date Mon, 21 Jul 2008 08:19:14 GMT

OK.

So Kaha is obviously garbage and not reliable. Will I get more reliability
with a DataSource store, say... the following:

    <persistenceAdapter>
        <journaledJDBC journalLogFiles="5"
dataDirectory="${activemq.base}/activemq-data" dataSource="#postgres-ds"/>
    </persistenceAdapter>

  <bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
    <property name="serverName" value="localhost"/>
    <property name="databaseName" value="activemq"/>
    <property name="portNumber" value="0"/>
    <property name="user" value="postgres"/>
    <property name="password" value=""/>
    <property name="dataSourceName" value="postgres"/>
    <property name="initialConnections" value="5"/>
    <property name="maxConnections" value="10"/>
  </bean>

I tried this, and it is persisting. I just want a reliable way to avoid
loosing 2 weeks worth of stats a second time.

Q


qbeukes wrote:
> 
> I'm not sure where it fails.
> 
> It failed when starting with the errors I gave previously. So I removed:
> /opt/apache-activemq-5.1.0/amqdata/kr-store/state/index-store-state
> 
> And now it fails with another error. Here is the log for when starting up:
> ACTIVEMQ_HOME: /opt/apache-activemq-5.1.0
> ACTIVEMQ_BASE: /opt/apache-activemq-5.1.0
> Loading message broker from: xbean:activemq.xml
> INFO  BrokerService                  - Using Persistence Adapter:
> AMQPersistenceAdapter(/opt/apache-activemq-5.1.0/amqdata)
> INFO  BrokerService                  - ActiveMQ 5.1.0 JMS Message Broker
> (localhost) is starting
> INFO  BrokerService                  - For help or more information please
> see: http://activemq.apache.org/
> INFO  AMQPersistenceAdapter          - AMQStore starting using directory:
> /opt/apache-activemq-5.1.0/amqdata
> INFO  ManagementContext              - JMX consoles can connect to
> service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
> INFO  KahaStore                      - Kaha Store using data directory
> /opt/apache-activemq-5.1.0/amqdata/kr-store/state
> ERROR BrokerService                  - Failed to start ActiveMQ JMS
> Message Broker. Reason: java.io.EOFException
> java.io.EOFException
>         at java.io.RandomAccessFile.readFully(RandomAccessFile.java:383)
>         at java.io.RandomAccessFile.readFully(RandomAccessFile.java:361)
>         at
> org.apache.activemq.kaha.impl.index.StoreIndexReader.readItem(StoreIndexReader.java:46)
>         at
> org.apache.activemq.kaha.impl.index.IndexManager.getIndex(IndexManager.java:67)
>         at
> org.apache.activemq.kaha.impl.IndexRootContainer.getRoot(IndexRootContainer.java:126)
>         at
> org.apache.activemq.kaha.impl.KahaStore.generateInterestInMapDataFiles(KahaStore.java:576)
>         at
> org.apache.activemq.kaha.impl.KahaStore.initialize(KahaStore.java:498)
>         at
> org.apache.activemq.kaha.impl.KahaStore.getMapContainerIds(KahaStore.java:256)
>         at
> org.apache.activemq.store.kahadaptor.KahaReferenceStoreAdapter.start(KahaReferenceStoreAdapter.java:94)
>         at
> org.apache.activemq.store.amq.AMQPersistenceAdapter.start(AMQPersistenceAdapter.java:224)
>         at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1577)
>         at
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1530)
>         at
> org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:540)
>         at
> org.apache.activemq.broker.BrokerService.start(BrokerService.java:444)
>         at
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:50)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
>         at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:400)
>         at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:736)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
>         at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
>         at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
>         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:111)
>         at
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:73)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:129)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:79)
>         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:222)
>         at org.apache.activemq.console.Main.main(Main.java:106)
> 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
> file [/opt/apache-activemq-5.1.0/activemq.xml]: Invocation of init method
> failed; nested exception is java.io.EOFException
> 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
> file [/opt/apache-activemq-5.1.0/activemq.xml]: Invocation of init method
> failed; nested exception is java.io.EOFException
>         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:129)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:79)
>         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:222)
>         at org.apache.activemq.console.Main.main(Main.java:106)
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0'
> defined in file [/opt/apache-activemq-5.1.0/activemq.xml]: Invocation of
> init method failed; nested exception is java.io.EOFException
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1260)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
>         at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:400)
>         at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:736)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
>         at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
>         at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
>         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:111)
>         at
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:73)
>         ... 10 more
> Caused by: java.io.EOFException
>         at java.io.RandomAccessFile.readFully(RandomAccessFile.java:383)
>         at java.io.RandomAccessFile.readFully(RandomAccessFile.java:361)
>         at
> org.apache.activemq.kaha.impl.index.StoreIndexReader.readItem(StoreIndexReader.java:46)
>         at
> org.apache.activemq.kaha.impl.index.IndexManager.getIndex(IndexManager.java:67)
>         at
> org.apache.activemq.kaha.impl.IndexRootContainer.getRoot(IndexRootContainer.java:126)
>         at
> org.apache.activemq.kaha.impl.KahaStore.generateInterestInMapDataFiles(KahaStore.java:576)
>         at
> org.apache.activemq.kaha.impl.KahaStore.initialize(KahaStore.java:498)
>         at
> org.apache.activemq.kaha.impl.KahaStore.getMapContainerIds(KahaStore.java:256)
>         at
> org.apache.activemq.store.kahadaptor.KahaReferenceStoreAdapter.start(KahaReferenceStoreAdapter.java:94)
>         at
> org.apache.activemq.store.amq.AMQPersistenceAdapter.start(AMQPersistenceAdapter.java:224)
>         at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1577)
>         at
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1530)
>         at
> org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:540)
>         at
> org.apache.activemq.broker.BrokerService.start(BrokerService.java:444)
>         at
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:50)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
>         ... 29 more
> ERROR: java.lang.Exception:
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in
> file [/opt/apache-activemq-5.1.0/activemq.xml]: Invocation of init method
> failed; nested exception is java.io.EOFException
> java.lang.Exception:
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in
> file [/opt/apache-activemq-5.1.0/activemq.xml]: Invocation of init method
> failed; nested exception is java.io.EOFException
>         at
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:99)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:129)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:79)
>         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:222)
>         at org.apache.activemq.console.Main.main(Main.java:106)
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0'
> defined in file [/opt/apache-activemq-5.1.0/activemq.xml]: Invocation of
> init method failed; nested exception is java.io.EOFException
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1260)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
>         at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:400)
>         at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:736)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
>         at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
>         at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
>         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:111)
>         at
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:73)
>         ... 10 more
> Caused by: java.io.EOFException
>         at java.io.RandomAccessFile.readFully(RandomAccessFile.java:383)
>         at java.io.RandomAccessFile.readFully(RandomAccessFile.java:361)
>         at
> org.apache.activemq.kaha.impl.index.StoreIndexReader.readItem(StoreIndexReader.java:46)
>         at
> org.apache.activemq.kaha.impl.index.IndexManager.getIndex(IndexManager.java:67)
>         at
> org.apache.activemq.kaha.impl.IndexRootContainer.getRoot(IndexRootContainer.java:126)
>         at
> org.apache.activemq.kaha.impl.KahaStore.generateInterestInMapDataFiles(KahaStore.java:576)
>         at
> org.apache.activemq.kaha.impl.KahaStore.initialize(KahaStore.java:498)
>         at
> org.apache.activemq.kaha.impl.KahaStore.getMapContainerIds(KahaStore.java:256)
>         at
> org.apache.activemq.store.kahadaptor.KahaReferenceStoreAdapter.start(KahaReferenceStoreAdapter.java:94)
>         at
> org.apache.activemq.store.amq.AMQPersistenceAdapter.start(AMQPersistenceAdapter.java:224)
>         at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1577)
>         at
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1530)
>         at
> org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:540)
>         at
> org.apache.activemq.broker.BrokerService.start(BrokerService.java:444)
>         at
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:50)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
>         ... 29 more
> 
> 

-- 
View this message in context: http://www.nabble.com/Urgent-java.lang.IndexOutOfBoundsException-in-ActiveMQ-Kaha-Storage---Data-lost--tp18502722p18564069.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Mime
View raw message