[ 
https://issues.apache.org/jira/browse/AMQ-5995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15065926#comment-15065926
 ] 

Tim Bain commented on AMQ-5995:
-------------------------------

[~tabish121] I'm not sure I agree that things are working as they should.

Broker upgrades are going to happen, and the requirement that they be done with 
an empty message store (between only some versions, with no information in the 
release notes about which ones, no less), or that the user apply temporary 
workarounds like running the old broker in a networked configuration that's not 
the standard config for the cluster, doesn't strike me as "how they should 
work."  As much as possible, broker upgrades should be seamless; sometimes 
that's not possible, but in this case it seems like code that would be able to 
read any version of OpenWire but only write the current one (and that could be 
less-efficient with older versions if necessary) wouldn't be all that hard and 
would eliminate this problem.

Alternatively, we could create a command-line utility to transform a set of 
KahaDB data files from an (offline) broker from one version to another.  That's 
a little clunkier for the user, but reasonable if it's substantially easier to 
implement.

So yes, they're working as designed, but not as they should, and I think that 
either this issue should be re-opened or it should be left closed but a new 
enhancement request should be submitted to capture one or the other approach I 
suggested.

> ActiveMQ exits on startup with UTFDataFormatException: bad string
> -----------------------------------------------------------------
>
>                 Key: AMQ-5995
>                 URL: https://issues.apache.org/jira/browse/AMQ-5995
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.12.0
>            Reporter: Gijsbert van den Brink
>
> When upgrading from 5.11.1 to 5.12, ActiveMQ does not start and exits with an 
> error (see full stack trace below). The issue occurs when ActiveMQ reads a 
> message from the store (in my case an Oracle database using 
> JDBCPersistenceAdapter) that was stored in 5.11.1 and tries to read in 
> 5.12.0. 
> Tim Bain sugested on the mailing list that maybe the Openwire format is 
> incompatible between 5.11.1 and 5.12.0. One thing I noticed when debugging 
> this is that 5.11.1 uses v6.MessageIdMarshaller, while 5.12.0 uses v11. Not 
> sure if that has anything to do with this issue though.
> ERROR o.a.activemq.broker.BrokerService - Failed to start Apache ActiveMQ 
> ([eda2e5a4c4d0, null], {}) 
> java.io.UTFDataFormatException: bad string 
>         at 
> org.apache.activemq.util.DataByteArrayInputStream.readUTF(DataByteArrayInputStream.java:315)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.openwire.v11.BaseDataStreamMarshaller.looseUnmarshalString(BaseDataStreamMarshaller.java:571)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.openwire.v11.MessageIdMarshaller.looseUnmarshal(MessageIdMarshaller.java:122)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.openwire.OpenWireFormat.looseUnmarshalNestedObject(OpenWireFormat.java:473)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.openwire.v11.BaseDataStreamMarshaller.looseUnmarsalNestedObject(BaseDataStreamMarshaller.java:466)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.openwire.v11.MessageMarshaller.looseUnmarshal(MessageMarshaller.java:220)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.openwire.v11.ActiveMQMessageMarshaller.looseUnmarshal(ActiveMQMessageMarshaller.java:101)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.openwire.v11.ActiveMQObjectMessageMarshaller.looseUnmarshal(ActiveMQObjectMessageMarshaller.java:101)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:366)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:200)
>  ~[activemq-client-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:266)
>  ~[activemq-jdbc-store-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:147)
>  ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:130) 
> ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:112)
>  ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:2297)
>  ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:2290)
>  ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:2247)
>  ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:981) 
> ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:2518)
>  ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.startVirtualConsumerDestinations(BrokerService.java:2657)
>  ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:2509)
>  ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.doStartBroker(BrokerService.java:692)
>  ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.startBroker(BrokerService.java:684) 
> ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerService.start(BrokerService.java:605) 
> ~[activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)
>  [activemq-spring-5.12.0.jar:5.12.0] 
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
> ~[na:1.7.0_75] 
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
> ~[na:1.7.0_75] 
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[na:1.7.0_75] 
>         at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75] 
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1640)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1581)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
>  [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)
>  [spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE] 
>         at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
>  [spring-context-3.2.11.RELEASE.jar:3.2.11.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.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
>  [activemq-spring-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
>  [activemq-spring-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71) 
> [activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54) 
> [activemq-broker-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
>  [activemq-console-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)
>  [activemq-console-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
>  [activemq-console-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)
>  [activemq-console-5.12.0.jar:5.12.0] 
>         at 
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104) 
> [activemq-console-5.12.0.jar:5.12.0] 
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
> ~[na:1.7.0_75] 
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
> ~[na:1.7.0_75] 
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[na:1.7.0_75] 
>         at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75] 
>         at org.apache.activemq.console.Main.runTaskClass(Main.java:262) 
> [activemq.jar:5.12.0] 
>         at org.apache.activemq.console.Main.main(Main.java:115) 
> [activemq.jar:5.12.0] 
> 2015-09-12 12:05:45,323 INFO  o.a.activemq.broker.BrokerService - Apache 
> ActiveMQ 5.12.0 (eda2e5a4c4d0, null) is shutting down 
> 2015-09-12 12:05:45,324 INFO  o.a.a.broker.TransportConnector - Connector 
> openwire stopped 
> See also: 
> http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-UTFDataFormatException-bad-string-tc4701955.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to