You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Alessandro Baggio (JIRA)" <ji...@apache.org> on 2017/10/23 11:20:00 UTC

[jira] [Created] (AMQ-6846) java.lang.NullPointerException on recovering next messages with jdbc adapter

Alessandro Baggio created AMQ-6846:
--------------------------------------

             Summary: java.lang.NullPointerException on recovering next messages with jdbc adapter
                 Key: AMQ-6846
                 URL: https://issues.apache.org/jira/browse/AMQ-6846
             Project: ActiveMQ
          Issue Type: Bug
          Components: JDBC
    Affects Versions: 5.15.0
            Reporter: Alessandro Baggio


Hi,

on broker side we have observed a series of the following exception that blocked the messages delivery of a specific queue to its consumers.

{code:java}
INFO   | jvm 2    | 2017/10/20 20:04:29 |  WARN | Exception 	
INFO   | jvm 2    | 2017/10/20 20:04:29 | java.lang.NullPointerException
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.util.ByteSequence.<init>(ByteSequence.java:32)[activemq-client-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.store.jdbc.JDBCMessageStore$4.recoverMessage(JDBCMessageStore.java:363)[activemq-jdbc-store-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doRecoverNextMessages(DefaultJDBCAdapter.java:1094)[activemq-jdbc-store-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.store.jdbc.JDBCMessageStore.recoverNextMessages(JDBCMessageStore.java:358)[activemq-jdbc-store-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.store.ProxyMessageStore.recoverNextMessages(ProxyMessageStore.java:110)[activemq-broker-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.broker.region.cursors.QueueStorePrefetch.doFillBatch(QueueStorePrefetch.java:127)[activemq-broker-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.broker.region.cursors.AbstractStoreCursor.fillBatch(AbstractStoreCursor.java:448)[activemq-broker-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.broker.region.cursors.AbstractStoreCursor.reset(AbstractStoreCursor.java:168)[activemq-broker-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.broker.region.cursors.StoreQueueCursor.reset(StoreQueueCursor.java:169)[activemq-broker-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.broker.region.Queue.doPageInForDispatch(Queue.java:1976)[activemq-broker-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.broker.region.Queue.pageInMessages(Queue.java:2205)[activemq-broker-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.broker.region.Queue.iterate(Queue.java:1641)[activemq-broker-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.thread.DedicatedTaskRunner.runTask(DedicatedTaskRunner.java:112)[activemq-client-5.15.0.jar:5.15.0]
INFO   | jvm 2    | 2017/10/20 20:04:29 |       at org.apache.activemq.thread.DedicatedTaskRunner$1.run(DedicatedTaskRunner.java:42)[activemq-client-5.15.0.jar:5.15.0]
{code}

We had to change the database schema used by the broker in order to make it working properly.
The problem seems to be related to null values in the binary representation of the messages stored in database. Indeed, performing the following query (on the old schema):

{code:java}
select container, count(*) from ACTIVEMQ.ACTIVEMQ_MSGS where msg is null group by container;
{code}

results in:

||Container||Count Messages||
|e://<myQueue>que|934|
|queue://<myQueue>|540|




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)