Andreas Schwarz created AMQ-7044:
------------------------------------

             Summary: NPE when browsing Messages
                 Key: AMQ-7044
                 URL: https://issues.apache.org/jira/browse/AMQ-7044
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.15.4
            Reporter: Andreas Schwarz


Hi,

we are using the HTTP connector of activeMQ. When browsing messages we can 
observe NullPointerExceptions.

The exception occurs because XStream uses reflection to unmarshall objects. The 
exception can be reproduced with following test
{code:java}
  @Test
  public void testNPE() throws IOException {
    ActiveMQTextMessage message = new ActiveMQTextMessage();

    WireFormat wireFormat = new XStreamWireFormat();

    ByteSequence marshalled = wireFormat.marshal(message);
    Object unmarshalled = wireFormat.unmarshal(marshalled);
    ActiveMQTextMessage message2 = (ActiveMQTextMessage) unmarshalled;
    message2.canProcessAsExpired();
  }{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to