You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by gijsbert802 <va...@zorgdomein.nl> on 2015/09/12 14:07:25 UTC

ActiveMQ exits on startup with UTFDataFormatException: bad string

Hi all,

I'm trying to upgrade ActiveMQ from 5.11.1 to 5.12, but I'm getting an error
when ActiveMQ is starting. It seems to come from the JDBCPersistenceAdapter.
We're using an Oracle database as persistent storage.

Other than the ActiveMQ version, nothing changed.

Here's the relevant logging:

2015-09-12 12:05:45,158 INFO  o.a.a.store.jdbc.LeaseDatabaseLocker -
eda2e5a4c4d0, becoming master with lease expiry Sat Sep 12 12:06:20 UTC 2015
on dataSource: JDBC URL = jdbc:oracle:thin:@//192.168.99.100:1521/orcl,
Username = activemq, partitions = 1, max (per partition) = 10, min (per
partition) = 0, idle max age = 60 min, idle test period = 240 min, strategy
= DEFAULT
2015-09-12 12:05:45,162 DEBUG o.a.a.s.jdbc.JDBCPersistenceAdapter - Cleaning
up old messages.
2015-09-12 12:05:45,162 DEBUG o.a.a.s.j.adapter.DefaultJDBCAdapter -
Executing SQL: DELETE FROM ACTIVEMQ_MSGS WHERE (PRIORITY=? AND ID <=      (
SELECT min(ACTIVEMQ_ACKS.LAST_ACKED_ID)       FROM ACTIVEMQ_ACKS WHERE
ACTIVEMQ_ACKS.CONTAINER=ACTIVEMQ_MSGS.CONTAINER        AND
ACTIVEMQ_ACKS.PRIORITY=?)   )
2015-09-12 12:05:45,170 DEBUG o.a.a.s.j.adapter.DefaultJDBCAdapter - Deleted
0 old message(s) at priority: 0
2015-09-12 12:05:45,174 DEBUG o.a.a.s.jdbc.JDBCPersistenceAdapter - Cleanup
done.
2015-09-12 12:05:45,320 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
...



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-UTFDataFormatException-bad-string-tp4701955.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ exits on startup with UTFDataFormatException: bad string

Posted by gijsbert802 <va...@zorgdomein.nl>.
The error occurs on startup, so I don't get a chance to connect an external
client. 
I tried replacing the client jar in activemq/lib (replaced
activemq-client-5.12.0.jar with activemq-client-5.11.1.jar), but that logs
another error.

2015-09-12 17:03:24,431 ERROR o.a.activemq.broker.BrokerService - Failed to
start Apache ActiveMQ ([eda2e5a4c4d0, null], {})
java.lang.IllegalArgumentException: Invalid version: 11, could not load
org.apache.activemq.openwire.v11.MarshallerFactory
	at
org.apache.activemq.openwire.OpenWireFormat.setVersion(OpenWireFormat.java:324)
~[activemq-client-5.11.1.jar:5.11.1]
	at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.doStart(JDBCPersistenceAdapter.java:318)
~[activemq-jdbc-store-5.12.0.jar:5.12.0]




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-UTFDataFormatException-bad-string-tp4701955p4701964.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ exits on startup with UTFDataFormatException: bad string

Posted by Christopher Shannon <ch...@gmail.com>.
OpenWire v11 was introduced in 5.12.0.

Can you try using a 5.11.1 client with a 5.12.0 broker?  I'm curious to see
if the error still exists if the OpenWire version falls back to v10.

On Sat, Sep 12, 2015 at 11:14 AM, Tim Bain <tb...@alumni.duke.edu> wrote:

> The interesting line in the stack trace is
>
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId().
> (The 5.11.1 version of that code is at
>
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.activemq/activemq-jdbc-store/5.11.1/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java
> ;
> 5.12.0 doesn't appear to be in GrepCode yet, but presumably it's very
> similar if not identical for that method.)
>
> It looks like it's trying to read an existing (5.11.1) message from the
> store and deciding it can't be unmarshalled properly.  That implies that
> either you got really unlucky and the 5.11.1 wrote a corrupted message just
> before you shut it down (unlikely) or the Openwire format is incompatible
> between 5.11.1 and 5.12.0 (which isn't supposed to happen and would be a
> big problem IMO) or Openwire itself is compatible but there's a bug causing
> it to behave incorrectly or causing us to read the message's bytes
> incorrectly.
>
> The 5.12.0 release notes (
> http://activemq.apache.org/activemq-5120-release.html) don't call out any
> incompatibility, and the list of fixes (
>
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311210&version=12329258
> )
> doesn't include anything that jumps out at me as explaining this behavior.
> Does anyone have any background on any changes that might be relevant here?
>
> Can you download the 5.12.0 code and attach a debugger with a breakpoint on
> that line to see if you're at least getting bytes in the array?
>
> An easy workaround would be to delete all messages from the database, but
> I'd like to troubleshoot this so we figure out what's going on, so if you
> do that, can you copy the database to a test instance so we can keep
> investigating?
>
> Tim
> On Sep 12, 2015 8:13 AM, "Weatherby,Gerard" <gw...@uchc.edu> wrote:
>
> > Total guess; I'd look at the encoding of your xml configuration files.
> > What's the operating system?
> >
> > > -----Original Message-----
> > > From: gijsbert802 [mailto:vandenbrink@zorgdomein.nl]
> > > Sent: Saturday, September 12, 2015 8:07 AM
> > > To: users@activemq.apache.org
> > > Subject: ActiveMQ exits on startup with UTFDataFormatException: bad
> > string
> > >
> > > Hi all,
> > >
> > > I'm trying to upgrade ActiveMQ from 5.11.1 to 5.12, but I'm getting an
> > error
> > > when ActiveMQ is starting. It seems to come from the
> > JDBCPersistenceAdapter.
> > > We're using an Oracle database as persistent storage.
> > >
> > > Other than the ActiveMQ version, nothing changed.
> > >
> > > Here's the relevant logging:
> > >
> > > 2015-09-12 12:05:45,158 INFO  o.a.a.store.jdbc.LeaseDatabaseLocker -
> > > eda2e5a4c4d0, becoming master with lease expiry Sat Sep 12 12:06:20 UTC
> > > 2015 on dataSource: JDBC URL = jdbc:oracle:thin:@//
> > 192.168.99.100:1521/orcl,
> > > Username = activemq, partitions = 1, max (per partition) = 10, min (per
> > > partition) = 0, idle max age = 60 min, idle test period = 240 min,
> > strategy =
> > > DEFAULT
> > > 2015-09-12 12:05:45,162 DEBUG o.a.a.s.jdbc.JDBCPersistenceAdapter -
> > > Cleaning up old messages.
> > > 2015-09-12 12:05:45,162 DEBUG o.a.a.s.j.adapter.DefaultJDBCAdapter -
> > > Executing SQL: DELETE FROM ACTIVEMQ_MSGS WHERE (PRIORITY=? AND ID <=
> > > (
> > > SELECT min(ACTIVEMQ_ACKS.LAST_ACKED_ID)       FROM ACTIVEMQ_ACKS
> > > WHERE
> > > ACTIVEMQ_ACKS.CONTAINER=ACTIVEMQ_MSGS.CONTAINER        AND
> > > ACTIVEMQ_ACKS.PRIORITY=?)   )
> > > 2015-09-12 12:05:45,170 DEBUG o.a.a.s.j.adapter.DefaultJDBCAdapter -
> > > Deleted
> > > 0 old message(s) at priority: 0
> > > 2015-09-12 12:05:45,174 DEBUG o.a.a.s.jdbc.JDBCPersistenceAdapter -
> > Cleanup
> > > done.
> > > 2015-09-12 12:05:45,320 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(DataByteArrayInp
> > > utStream.java:315)
> > > ~[activemq-client-5.12.0.jar:5.12.0]
> > >       at
> > > org.apache.activemq.openwire.v11.BaseDataStreamMarshaller.looseUnmarsha
> > > lString(BaseDataStreamMarshaller.java:571)
> > > ~[activemq-client-5.12.0.jar:5.12.0]
> > >       at
> > > org.apache.activemq.openwire.v11.MessageIdMarshaller.looseUnmarshal(Mes
> > > sageIdMarshaller.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.looseUnmarsal
> > > NestedObject(BaseDataStreamMarshaller.java:466)
> > > ~[activemq-client-5.12.0.jar:5.12.0]
> > >       at
> > > org.apache.activemq.openwire.v11.MessageMarshaller.looseUnmarshal(Messa
> > > geMarshaller.java:220)
> > > ~[activemq-client-5.12.0.jar:5.12.0]
> > >       at
> > > org.apache.activemq.openwire.v11.ActiveMQMessageMarshaller.looseUnmars
> > > hal(ActiveMQMessageMarshaller.java:101)
> > > ~[activemq-client-5.12.0.jar:5.12.0]
> > >       at
> > > org.apache.activemq.openwire.v11.ActiveMQObjectMessageMarshaller.looseU
> > > nmarshal(ActiveMQObjectMessageMarshaller.java:101)
> > > ~[activemq-client-5.12.0.jar:5.12.0]
> > >       at
> > > org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireForm
> > > at.java:366)
> > > ~[activemq-client-5.12.0.jar:5.12.0]
> > >       at
> > > org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.j
> > > ava:200)
> > > ~[activemq-client-5.12.0.jar:5.12.0]
> > >       at
> > >
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBroke
> > > rSequenceId(JDBCPersistenceAdapter.java:266)
> > > ~[activemq-jdbc-store-5.12.0.jar:5.12.0]
> > >       at
> > >
> >
> org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBro
> > > kerSequenceId(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>(ManagedRegion
> > > Broker.java:112)
> > > ~[activemq-broker-5.12.0.jar:5.12.0]
> > >       at
> > >
> >
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.j
> > > ava:2297)
> > > ~[activemq-broker-5.12.0.jar:5.12.0]
> > >       at
> > >
> >
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.j
> > > ava:2290)
> > > ~[activemq-broker-5.12.0.jar:5.12.0]
> > >       at
> > >
> >
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:224
> > > 7)
> > > ~[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(Broker
> > > Service.java:2518)
> > > ~[activemq-broker-5.12.0.jar:5.12.0]
> > >       at
> > >
> >
> org.apache.activemq.broker.BrokerService.startVirtualConsumerDestinations(Br
> > > okerService.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:69
> > > 2)
> > > ~[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(XBeanBrok
> > > erService.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(DelegatingMethodAccessorI
> > > mpl.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.AbstractAutowireCapableBeanFact
> > >
> ory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1640)
> > > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> > > ory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1581)
> > > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> > > ory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)
> > > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> > > ory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
> > > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> > > ory.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.getSi
> > > ngleton(DefaultSingletonBeanRegistry.java:223)
> > > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(A
> > > bstractBeanFactory.java:290)
> > > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> >
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abst
> > > ractBeanFactory.java:191)
> > > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> >
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
> > > antiateSingletons(DefaultListableBeanFactory.java:636)
> > > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> >
> org.springframework.context.support.AbstractApplicationContext.finishBeanFa
> > > ctoryInitialization(AbstractApplicationContext.java:934)
> > > [spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> >
> org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
> > > actApplicationContext.java:479)
> > > [spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> > >       at
> > >
> >
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(Resour
> > > ceXmlApplicationContext.java:64)
> > > [xbean-spring-3.18.jar:3.18]
> > >       at
> > >
> >
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(Resour
> > > ceXmlApplicationContext.java:52)
> > > [xbean-spring-3.18.jar:3.18]
> > >       at
> > >
> >
> org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.j
> > > ava:104)
> > > [activemq-spring-5.12.0.jar:5.12.0]
> > >       at
> > >
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBe
> > > anBrokerFactory.java:104)
> > > [activemq-spring-5.12.0.jar:5.12.0]
> > >       at
> > >
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFac
> > > tory.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(AbstractCo
> > > mmand.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(AbstractCo
> > > mmand.java:62)
> > > [activemq-console-5.12.0.jar:5.12.0]
> > >       at
> > > org.apache.activemq.console.command.ShellCommand.main(ShellCommand.ja
> > > va: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(DelegatingMethodAccessorI
> > > mpl.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 ...
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > > http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-
> > > UTFDataFormatException-bad-string-tp4701955.html
> > > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>

Re: ActiveMQ exits on startup with UTFDataFormatException: bad string

Posted by Tim Bain <tb...@alumni.duke.edu>.
Great, thank you!
On Oct 1, 2015 11:01 AM, "gijsbert802" <va...@zorgdomein.nl> wrote:

> Thanks Tim.
>
> I created an issue: https://issues.apache.org/jira/browse/AMQ-5995
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-UTFDataFormatException-bad-string-tp4701955p4702535.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: ActiveMQ exits on startup with UTFDataFormatException: bad string

Posted by gijsbert802 <va...@zorgdomein.nl>.
Thanks Tim.

I created an issue: https://issues.apache.org/jira/browse/AMQ-5995




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-UTFDataFormatException-bad-string-tp4701955p4702535.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ exits on startup with UTFDataFormatException: bad string

Posted by Tim Bain <tb...@alumni.duke.edu>.
I was hoping that one of the devs (Gary, Tim, Art, etc.) would jump into
this discussion, but since they didn't, please submit a JIRA bug to bring
this issue to their attention.  If the problem is that the OpenWire
versions aren't backwards-compatible, that's either a bug (I was under the
impression that OpenWire was consciously intended to always be
backwards-compatible) or a design change that should have been called out
overtly in the release notes and wasn't.  Submit a bug and someone will
figure out which situation it was and work on a fix.

Thanks for bringing it to our attention.

Tim

On Sun, Sep 13, 2015 at 4:50 AM, gijsbert802 <va...@zorgdomein.nl>
wrote:

> I did some more debugging and compared 5.11.1 to 5.12.0. What I noticed is
> that 5.11.1 uses v6.MessageIdMarshaller, while 5.12.0 uses v11. Is 5.11.1
> supposed to use the v6 version?
>
> v6 doesn't have the line where the error occurs
> (info.setTextView(looseUnmarshalString(dataIn));).
>
> Let me know if you need more debugging data, I'm happy to help.
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-UTFDataFormatException-bad-string-tp4701955p4701965.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

RE: ActiveMQ exits on startup with UTFDataFormatException: bad string

Posted by gijsbert802 <va...@zorgdomein.nl>.
I did some more debugging and compared 5.11.1 to 5.12.0. What I noticed is
that 5.11.1 uses v6.MessageIdMarshaller, while 5.12.0 uses v11. Is 5.11.1
supposed to use the v6 version?

v6 doesn't have the line where the error occurs
(info.setTextView(looseUnmarshalString(dataIn));).

Let me know if you need more debugging data, I'm happy to help.




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-UTFDataFormatException-bad-string-tp4701955p4701965.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: ActiveMQ exits on startup with UTFDataFormatException: bad string

Posted by gijsbert802 <va...@zorgdomein.nl>.
I don't think there's a corrupt message, if I revert back to 5.11.1 then
ActiveMQ starts normally.

I ran ActiveMQ with a debugger and was able to reproduce the error. The byte
array that is loaded by getAdapter().doGetMessageById(c, seq); is not empty,
I dumped the complete content to a file and uploaded it to
http://we.tl/PdBIMVinOG
Does that help?

Btw. I also tried to reproduce the error using kahadb in stead of Oracle,
but with kahadb there's no problem.




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-UTFDataFormatException-bad-string-tp4701955p4701963.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: ActiveMQ exits on startup with UTFDataFormatException: bad string

Posted by Tim Bain <tb...@alumni.duke.edu>.
The interesting line in the stack trace is
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId().
(The 5.11.1 version of that code is at
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.activemq/activemq-jdbc-store/5.11.1/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java;
5.12.0 doesn't appear to be in GrepCode yet, but presumably it's very
similar if not identical for that method.)

It looks like it's trying to read an existing (5.11.1) message from the
store and deciding it can't be unmarshalled properly.  That implies that
either you got really unlucky and the 5.11.1 wrote a corrupted message just
before you shut it down (unlikely) or the Openwire format is incompatible
between 5.11.1 and 5.12.0 (which isn't supposed to happen and would be a
big problem IMO) or Openwire itself is compatible but there's a bug causing
it to behave incorrectly or causing us to read the message's bytes
incorrectly.

The 5.12.0 release notes (
http://activemq.apache.org/activemq-5120-release.html) don't call out any
incompatibility, and the list of fixes (
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311210&version=12329258)
doesn't include anything that jumps out at me as explaining this behavior.
Does anyone have any background on any changes that might be relevant here?

Can you download the 5.12.0 code and attach a debugger with a breakpoint on
that line to see if you're at least getting bytes in the array?

An easy workaround would be to delete all messages from the database, but
I'd like to troubleshoot this so we figure out what's going on, so if you
do that, can you copy the database to a test instance so we can keep
investigating?

Tim
On Sep 12, 2015 8:13 AM, "Weatherby,Gerard" <gw...@uchc.edu> wrote:

> Total guess; I'd look at the encoding of your xml configuration files.
> What's the operating system?
>
> > -----Original Message-----
> > From: gijsbert802 [mailto:vandenbrink@zorgdomein.nl]
> > Sent: Saturday, September 12, 2015 8:07 AM
> > To: users@activemq.apache.org
> > Subject: ActiveMQ exits on startup with UTFDataFormatException: bad
> string
> >
> > Hi all,
> >
> > I'm trying to upgrade ActiveMQ from 5.11.1 to 5.12, but I'm getting an
> error
> > when ActiveMQ is starting. It seems to come from the
> JDBCPersistenceAdapter.
> > We're using an Oracle database as persistent storage.
> >
> > Other than the ActiveMQ version, nothing changed.
> >
> > Here's the relevant logging:
> >
> > 2015-09-12 12:05:45,158 INFO  o.a.a.store.jdbc.LeaseDatabaseLocker -
> > eda2e5a4c4d0, becoming master with lease expiry Sat Sep 12 12:06:20 UTC
> > 2015 on dataSource: JDBC URL = jdbc:oracle:thin:@//
> 192.168.99.100:1521/orcl,
> > Username = activemq, partitions = 1, max (per partition) = 10, min (per
> > partition) = 0, idle max age = 60 min, idle test period = 240 min,
> strategy =
> > DEFAULT
> > 2015-09-12 12:05:45,162 DEBUG o.a.a.s.jdbc.JDBCPersistenceAdapter -
> > Cleaning up old messages.
> > 2015-09-12 12:05:45,162 DEBUG o.a.a.s.j.adapter.DefaultJDBCAdapter -
> > Executing SQL: DELETE FROM ACTIVEMQ_MSGS WHERE (PRIORITY=? AND ID <=
> > (
> > SELECT min(ACTIVEMQ_ACKS.LAST_ACKED_ID)       FROM ACTIVEMQ_ACKS
> > WHERE
> > ACTIVEMQ_ACKS.CONTAINER=ACTIVEMQ_MSGS.CONTAINER        AND
> > ACTIVEMQ_ACKS.PRIORITY=?)   )
> > 2015-09-12 12:05:45,170 DEBUG o.a.a.s.j.adapter.DefaultJDBCAdapter -
> > Deleted
> > 0 old message(s) at priority: 0
> > 2015-09-12 12:05:45,174 DEBUG o.a.a.s.jdbc.JDBCPersistenceAdapter -
> Cleanup
> > done.
> > 2015-09-12 12:05:45,320 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(DataByteArrayInp
> > utStream.java:315)
> > ~[activemq-client-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.openwire.v11.BaseDataStreamMarshaller.looseUnmarsha
> > lString(BaseDataStreamMarshaller.java:571)
> > ~[activemq-client-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.openwire.v11.MessageIdMarshaller.looseUnmarshal(Mes
> > sageIdMarshaller.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.looseUnmarsal
> > NestedObject(BaseDataStreamMarshaller.java:466)
> > ~[activemq-client-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.openwire.v11.MessageMarshaller.looseUnmarshal(Messa
> > geMarshaller.java:220)
> > ~[activemq-client-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.openwire.v11.ActiveMQMessageMarshaller.looseUnmars
> > hal(ActiveMQMessageMarshaller.java:101)
> > ~[activemq-client-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.openwire.v11.ActiveMQObjectMessageMarshaller.looseU
> > nmarshal(ActiveMQObjectMessageMarshaller.java:101)
> > ~[activemq-client-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireForm
> > at.java:366)
> > ~[activemq-client-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.j
> > ava:200)
> > ~[activemq-client-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBroke
> > rSequenceId(JDBCPersistenceAdapter.java:266)
> > ~[activemq-jdbc-store-5.12.0.jar:5.12.0]
> >       at
> >
> org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBro
> > kerSequenceId(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>(ManagedRegion
> > Broker.java:112)
> > ~[activemq-broker-5.12.0.jar:5.12.0]
> >       at
> >
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.j
> > ava:2297)
> > ~[activemq-broker-5.12.0.jar:5.12.0]
> >       at
> >
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.j
> > ava:2290)
> > ~[activemq-broker-5.12.0.jar:5.12.0]
> >       at
> >
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:224
> > 7)
> > ~[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(Broker
> > Service.java:2518)
> > ~[activemq-broker-5.12.0.jar:5.12.0]
> >       at
> >
> org.apache.activemq.broker.BrokerService.startVirtualConsumerDestinations(Br
> > okerService.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:69
> > 2)
> > ~[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(XBeanBrok
> > erService.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(DelegatingMethodAccessorI
> > mpl.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.AbstractAutowireCapableBeanFact
> > ory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1640)
> > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> > ory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1581)
> > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> > ory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)
> > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> > ory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
> > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> > ory.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.getSi
> > ngleton(DefaultSingletonBeanRegistry.java:223)
> > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> > org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(A
> > bstractBeanFactory.java:290)
> > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> >
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abst
> > ractBeanFactory.java:191)
> > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> >
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
> > antiateSingletons(DefaultListableBeanFactory.java:636)
> > [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> >
> org.springframework.context.support.AbstractApplicationContext.finishBeanFa
> > ctoryInitialization(AbstractApplicationContext.java:934)
> > [spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> >
> org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
> > actApplicationContext.java:479)
> > [spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> >       at
> >
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(Resour
> > ceXmlApplicationContext.java:64)
> > [xbean-spring-3.18.jar:3.18]
> >       at
> >
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(Resour
> > ceXmlApplicationContext.java:52)
> > [xbean-spring-3.18.jar:3.18]
> >       at
> >
> org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.j
> > ava:104)
> > [activemq-spring-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBe
> > anBrokerFactory.java:104)
> > [activemq-spring-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFac
> > tory.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(AbstractCo
> > mmand.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(AbstractCo
> > mmand.java:62)
> > [activemq-console-5.12.0.jar:5.12.0]
> >       at
> > org.apache.activemq.console.command.ShellCommand.main(ShellCommand.ja
> > va: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(DelegatingMethodAccessorI
> > mpl.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 ...
> >
> >
> >
> > --
> > View this message in context:
> > http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-
> > UTFDataFormatException-bad-string-tp4701955.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

RE: ActiveMQ exits on startup with UTFDataFormatException: bad string

Posted by "Weatherby,Gerard" <gw...@uchc.edu>.
Total guess; I'd look at the encoding of your xml configuration files. What's the operating system?

> -----Original Message-----
> From: gijsbert802 [mailto:vandenbrink@zorgdomein.nl]
> Sent: Saturday, September 12, 2015 8:07 AM
> To: users@activemq.apache.org
> Subject: ActiveMQ exits on startup with UTFDataFormatException: bad string
> 
> Hi all,
> 
> I'm trying to upgrade ActiveMQ from 5.11.1 to 5.12, but I'm getting an error
> when ActiveMQ is starting. It seems to come from the JDBCPersistenceAdapter.
> We're using an Oracle database as persistent storage.
> 
> Other than the ActiveMQ version, nothing changed.
> 
> Here's the relevant logging:
> 
> 2015-09-12 12:05:45,158 INFO  o.a.a.store.jdbc.LeaseDatabaseLocker -
> eda2e5a4c4d0, becoming master with lease expiry Sat Sep 12 12:06:20 UTC
> 2015 on dataSource: JDBC URL = jdbc:oracle:thin:@//192.168.99.100:1521/orcl,
> Username = activemq, partitions = 1, max (per partition) = 10, min (per
> partition) = 0, idle max age = 60 min, idle test period = 240 min, strategy =
> DEFAULT
> 2015-09-12 12:05:45,162 DEBUG o.a.a.s.jdbc.JDBCPersistenceAdapter -
> Cleaning up old messages.
> 2015-09-12 12:05:45,162 DEBUG o.a.a.s.j.adapter.DefaultJDBCAdapter -
> Executing SQL: DELETE FROM ACTIVEMQ_MSGS WHERE (PRIORITY=? AND ID <=
> (
> SELECT min(ACTIVEMQ_ACKS.LAST_ACKED_ID)       FROM ACTIVEMQ_ACKS
> WHERE
> ACTIVEMQ_ACKS.CONTAINER=ACTIVEMQ_MSGS.CONTAINER        AND
> ACTIVEMQ_ACKS.PRIORITY=?)   )
> 2015-09-12 12:05:45,170 DEBUG o.a.a.s.j.adapter.DefaultJDBCAdapter -
> Deleted
> 0 old message(s) at priority: 0
> 2015-09-12 12:05:45,174 DEBUG o.a.a.s.jdbc.JDBCPersistenceAdapter - Cleanup
> done.
> 2015-09-12 12:05:45,320 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(DataByteArrayInp
> utStream.java:315)
> ~[activemq-client-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.openwire.v11.BaseDataStreamMarshaller.looseUnmarsha
> lString(BaseDataStreamMarshaller.java:571)
> ~[activemq-client-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.openwire.v11.MessageIdMarshaller.looseUnmarshal(Mes
> sageIdMarshaller.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.looseUnmarsal
> NestedObject(BaseDataStreamMarshaller.java:466)
> ~[activemq-client-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.openwire.v11.MessageMarshaller.looseUnmarshal(Messa
> geMarshaller.java:220)
> ~[activemq-client-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.openwire.v11.ActiveMQMessageMarshaller.looseUnmars
> hal(ActiveMQMessageMarshaller.java:101)
> ~[activemq-client-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.openwire.v11.ActiveMQObjectMessageMarshaller.looseU
> nmarshal(ActiveMQObjectMessageMarshaller.java:101)
> ~[activemq-client-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireForm
> at.java:366)
> ~[activemq-client-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.j
> ava:200)
> ~[activemq-client-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBroke
> rSequenceId(JDBCPersistenceAdapter.java:266)
> ~[activemq-jdbc-store-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBro
> kerSequenceId(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>(ManagedRegion
> Broker.java:112)
> ~[activemq-broker-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.j
> ava:2297)
> ~[activemq-broker-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.j
> ava:2290)
> ~[activemq-broker-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:224
> 7)
> ~[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(Broker
> Service.java:2518)
> ~[activemq-broker-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.broker.BrokerService.startVirtualConsumerDestinations(Br
> okerService.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:69
> 2)
> ~[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(XBeanBrok
> erService.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(DelegatingMethodAccessorI
> mpl.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.AbstractAutowireCapableBeanFact
> ory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1640)
> [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1581)
> [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)
> [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
> [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.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.getSi
> ngleton(DefaultSingletonBeanRegistry.java:223)
> [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(A
> bstractBeanFactory.java:290)
> [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abst
> ractBeanFactory.java:191)
> [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
> antiateSingletons(DefaultListableBeanFactory.java:636)
> [spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFa
> ctoryInitialization(AbstractApplicationContext.java:934)
> [spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
> actApplicationContext.java:479)
> [spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE]
> 	at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(Resour
> ceXmlApplicationContext.java:64)
> [xbean-spring-3.18.jar:3.18]
> 	at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(Resour
> ceXmlApplicationContext.java:52)
> [xbean-spring-3.18.jar:3.18]
> 	at
> org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.j
> ava:104)
> [activemq-spring-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBe
> anBrokerFactory.java:104)
> [activemq-spring-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFac
> tory.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(AbstractCo
> mmand.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(AbstractCo
> mmand.java:62)
> [activemq-console-5.12.0.jar:5.12.0]
> 	at
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.ja
> va: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(DelegatingMethodAccessorI
> mpl.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 ...
> 
> 
> 
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-exits-on-startup-with-
> UTFDataFormatException-bad-string-tp4701955.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.