Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-6846

java.lang.NullPointerException on recovering next messages with jdbc adapter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.15.0
    • None
    • JDBC
    • None

    Description

      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.

      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]
      

      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):

      select container, count(*) from ACTIVEMQ.ACTIVEMQ_MSGS where msg is null group by container;
      

      results in:

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            a.baggio Alessandro Baggio
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: