Java client null pointer exception thrown when there is no exchange set for 
ReplyTo
-----------------------------------------------------------------------------------

                 Key: QPID-2959
                 URL: https://issues.apache.org/jira/browse/QPID-2959
             Project: Qpid
          Issue Type: Bug
          Components: Java Client
    Affects Versions: 0.8
            Reporter: Rajith Attapattu
            Assignee: Rajith Attapattu
            Priority: Minor
             Fix For: 0.9


If the ReplyTo exchange is not set on a message read by the Java client, and
getJMSReplyTo is called, the code does not properly handle the exchange being
null.

In the following code, replyTo.getExchange() returns null, so the String
exchange is set to null, and thus the first argument to generateDestination
ends up being null.

AMQMessageDelegate_0_10.getJMSReplyTo() line: 224 
            if (dest == null)
            {
                String exchange = replyTo.getExchange();
                String routingKey = replyTo.getRoutingKey();

                dest = generateDestination(exchange == null ? null : new
AMQShortString(exchange),
                        routingKey == null ? null : new
AMQShortString(routingKey));

In the following code, you can see that if the first argument (exchange) is
null, you'll get a null pointer exception when the code attempts to call
exchange.asString().

protected AMQDestination generateDestination(AMQShortString exchange,
AMQShortString routingKey)
    {
        AMQDestination dest;
        ExchangeInfo exchangeInfo = _exchangeMap.get(exchange.asString());



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to