You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rajith Attapattu (JIRA)" <ji...@apache.org> on 2011/03/17 22:32:29 UTC

[jira] Resolved: (QPID-2959) Java client null pointer exception thrown when there is no exchange set for ReplyTo

     [ https://issues.apache.org/jira/browse/QPID-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu resolved QPID-2959.
------------------------------------

    Resolution: Fixed

Fixed along with a test case.

> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org