activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Shannon <christopher.l.shan...@gmail.com>
Subject Re: Updating KahaDB
Date Thu, 04 Aug 2016 11:46:07 GMT
Between those 2 versions the open OpenWire version used was upgraded as you
saw.  This is not an issue when starting with a fresh store but as you are
seeing, when you upgrade from an existing store you will have old journal
files with messages laying around that were written using the older
OpenWire version (in this case version 6).  Obviously if version 11
marshallers are used to read this data then errors will occur.

To attempt to handle this, KahaDB keeps track of the version of OpenWire
that was used so that on start up it knows the correct version.  This
information is stored in the db.data file (the KahaDB index)  So when you
removed it, the index had to be rebuilt which means replaying the journal
and re-reading everything.  Deleting the index means that any record of
version 6 being used is gone so the journal was replayed using version 11
which resulted in the errors you are seeing.

The best way to fix this would be to start with a fresh store.  But if you
want to keep the old store laying around and want to make sure that the
broker can recover even if the index is gone or corrupt then you can tell
the broker to use the correct OpenWire version by setting the property on
the BrokerService called storeOpenWireVersion.

<broker brokerName="broker" storeOpenWireVersion="6" ... >
   ...
</broker>

This will force the broker to always use Version 6 for the store.

On Thu, Aug 4, 2016 at 7:29 AM, Tim Bain <tbain@alumni.duke.edu> wrote:

> Is doesn't resolve the question of why the index rebuild doesn't work, but
> one path forward is to stand up a new broker with an empty KahaDB store and
> then stand up this one with a networkConnector to the new one.  Have all
> clients connect to the new (empty) broker, which will be using the new
> message format.  As consumers connect, messages from the destinations they
> are subscribed to will flow to the new broker and then to the consumer.
> Once a consumer has connected for each destination, your "old" broker will
> be empty and can be shut down, and your configuration will go back to
> nominal.
>
> We should handle this better than we do, but implementing something to make
> it better hasn't made it to the top of anyone's list yet.  I submitted
> https://issues.apache.org/jira/browse/AMQ-6099 to capture the need, so if
> you have time you'd be interested in donating, you could implement a fix
> and contribute it back.
>
> Tim
>
> On Aug 4, 2016 4:53 AM, "Martin Herrman" <mherrman@ymor.nl> wrote:
>
> > Dear ActiveMQ users,
> >
> > I just upgraded our ActiveMQ deployment from release 5.11.1 to 5.13.4
> (I'm
> > on Ubuntu 14.04.5), which went pretty smooth. On this server ActiveMQ has
> > been updated many times so I was not surprised to get this in the logs
> > during startup:
> >
> > WARN  | Existing Store uses a different OpenWire version[6] than the
> > version configured[11] reverting to the version used by this store, some
> > newer broker features may not work as expected.
> >
> > So I started a google search and found this:
> >
> >
> > https://access.redhat.com/documentation/en-US/Red_Hat_
> JBoss_A-MQ/6.0/html-single/Migration_Guide/index.html#Summary-Procedure
> >
> > Step 3 notes that to automatically upgrade to the latest version it might
> > be required to remove the db.data and db.redo files first before starting
> > ActiveMQ again. So that is what I did, but now ActiveMQ fails to startup
> > properly:
> >
> >  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@34e51ca2: startup date
> > [Thu Aug 04 12:23:50 CEST 2016]; root of context hierarchy
> > at
> > org.springframework.context.support.AbstractApplicationContext.
> getLifecycleProcessor(AbstractApplicationContext.
> java:357)[spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.context.support.AbstractApplicationContext.doClose(
> AbstractApplicationContext.java:884)[spring-context-4.1.
> 9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.context.support.AbstractApplicationContext.close(
> AbstractApplicationContext.java:843)[spring-context-4.1.
> 9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.apache.activemq.hooks.SpringContextHook.run(
> SpringContextHook.java:30)[activemq-spring-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.broker.BrokerService.stop(BrokerService.java:873)[
> activemq-broker-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.xbean.XBeanBrokerService.stop(
> XBeanBrokerService.java:122)[activemq-spring-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.broker.BrokerService.start(BrokerService.java:627)[
> activemq-broker-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(
> XBeanBrokerService.java:73)[activemq-spring-5.13.4.jar:5.13.4]
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:1.7.0_101]
> > at
> > sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:57)[:1.7.0_101]
> > at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)[:1.7.0_101]
> > at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_101]
> > at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFac
> tory.java:1700)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeInitMethods(AbstractAutowireCapableBeanFac
> tory.java:1639)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.initializeBean(AbstractAutowireCapableBeanFac
> tory.java:1568)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.doCreateBean(AbstractAutowireCapableBeanFac
> tory.java:539)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.createBean(AbstractAutowireCapableBeanFac
> tory.java:476)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.beans.factory.support.AbstractBeanFactory$1.
> getObject(AbstractBeanFactory.java:303)[spring-beans-4.1.9.
> RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.
> getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.1.9.
> RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
> AbstractBeanFactory.java:299)[spring-beans-4.1.9.RELEASE.
> jar:4.1.9.RELEASE]
> > at
> > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBeanFactory.java:194)[spring-beans-4.1.9.RELEASE.
> jar:4.1.9.RELEASE]
> > at
> > org.springframework.beans.factory.support.DefaultListableBeanFactory.
> preInstantiateSingletons(DefaultListableBeanFactory.
> java:755)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.context.support.AbstractApplicationContext.
> finishBeanFactoryInitialization(AbstractApplicationContext.
> java:762)[spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.springframework.context.support.AbstractApplicationContext.refresh(
> AbstractApplicationContext.java:480)[spring-context-4.1.
> 9.RELEASE.jar:4.1.9.RELEASE]
> > at
> > org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(
> ResourceXmlApplicationContext.java:64)[xbean-spring-3.18.jar:3.18]
> > at
> > org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(
> ResourceXmlApplicationContext.java:52)[xbean-spring-3.18.jar:3.18]
> > at
> > org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(
> XBeanBrokerFactory.java:104)[activemq-spring-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(
> XBeanBrokerFactory.java:104)[activemq-spring-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(
> XBeanBrokerFactory.java:67)[activemq-spring-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.broker.BrokerFactory.createBroker(
> BrokerFactory.java:71)[activemq-broker-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.broker.BrokerFactory.createBroker(
> BrokerFactory.java:54)[activemq-broker-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.console.command.StartCommand.runTask(
> StartCommand.java:87)[activemq-console-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.console.command.AbstractCommand.
> execute(AbstractCommand.java:63)[activemq-console-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.console.command.ShellCommand.runTask(
> ShellCommand.java:154)[activemq-console-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.console.command.AbstractCommand.
> execute(AbstractCommand.java:63)[activemq-console-5.13.4.jar:5.13.4]
> > at
> > org.apache.activemq.console.command.ShellCommand.main(
> ShellCommand.java:104)[activemq-console-5.13.4.jar:5.13.4]
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:1.7.0_101]
> > at
> > sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:57)[:1.7.0_101]
> > at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)[:1.7.0_101]
> > at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_101]
> > at
> > org.apache.activemq.console.Main.runTaskClass(Main.java:
> 262)[activemq.jar:5.13.4]
> > at
> > org.apache.activemq.console.Main.main(Main.java:115)[
> activemq.jar:5.13.4]
> > 2016-08-04 12:24:36,838 | WARN  | Exception encountered during context
> > initialization - cancelling refresh attempt:
> > 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.io.EOFException |
> > org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
> >
> > So I went back to my kahadb backup files (including the db.data and
> > db.redo files) and everything works again (but the warning message about
> > the openwire version is still not solved).
> >
> > The strange part here is that the exception shows an EOF exception on
> > activemq.xml. But I only changed the kahadb files, not the activemq.xml.
> >
> > Any hints, tips or advise?
> >
> > Thanks in advance!
> > Met vriendelijke groet/Kind regards,
> >
> > Martin Herrman
> > Manager DevOps
> >
> > [YMOR]<http://www.ymor.com>
> >
> > Ptolemaeuslaan 70
> > 3528 BP Utrecht
> > Mobiel: +31 6 10761936
> > Kantoor:        +31(0)30 6021149
> >
> > Email:  mherrman@ymor.nl
> >
> > [ITOA]
> > Van reactief naar preventief IT-beheer?
> > Download de whitepaper:
> > 'Van achteruitkijkspiegel naar glazen bol met IT Operations Analytics’<
> > http://www.ymor.com/whitepapers/>
> >
> >
> > This e-mail message and its attachments are subject to the disclaimer
> > published on our website<
> > https://www.ymor.com/files/2016/04/2016-Disclaimer-and-Security-EN.pdf>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message