You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Ievgen Tarasov (JIRA)" <ji...@apache.org> on 2015/06/01 14:41:17 UTC

[jira] [Created] (AMQ-5816) NPE during sending a message when using http transport and leveldb store

Ievgen Tarasov created AMQ-5816:
-----------------------------------

             Summary: NPE during sending a message when using http transport and leveldb store
                 Key: AMQ-5816
                 URL: https://issues.apache.org/jira/browse/AMQ-5816
             Project: ActiveMQ
          Issue Type: Bug
          Components: activemq-leveldb-store, Broker
    Affects Versions: 5.11.1, 5.11.0
            Reporter: Ievgen Tarasov


It is impossible to use combination of HTTP transport with LevelDB as persistent store: when trying to send a persistent message the broker throws a NullPointerException (see attachment Exception).

This happens because HTTP transport uses XStream library for deserealization, which follows Java Serialization rules. As a result, transient field [dataLocator|https://github.com/apache/activemq/blob/activemq-5.11.1/activemq-client/src/main/java/org/apache/activemq/command/MessageId.java#L37] is null after deserialization. Later, LevelDB invokes getDataLocator, and that's when NPE is thrown.

Proposed patch adds private method readResolve, which is invoked after deserialization, and which initializes dataLocator field.



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