Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2959

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.8
    • 0.9
    • JMS AMQP 0-x
    • None

    Description

      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());

      Attachments

        Activity

          People

            rajith Rajith Muditha Attapattu
            rajith Rajith Muditha Attapattu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: