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

QueueBrowser creation does not work with Address syntax via 'destination.' entries in JNDI properties files

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.15
    • Fix Version/s: 0.15
    • Component/s: Broker-J
    • Labels:

      Description

      I create my queue using the JNDI properties, and when I try to create a queue browser from the Destination object, I get the
      java.lang.ClassCastException: org.apache.qpid.client.AMQAnyDestination cannot be cast to org.apache.qpid.client.AMQQueue
      at org.apache.qpid.client.AMQSession.createBrowser(AMQSession.java:963)
      at org.apache.qpid.client.AMQSession.createBrowser(AMQSession.java:950)

      A sample code snippet is below; (just to give an idea).

      Properties properties = new Properties();
      String queueAddress = "T1;{create: always , node : {type : queue, durable : true}}"
      properties.put("destination.T1", queueAddress);
      InitialContext ctx = new InitialContext(properties);
      Destination queue = (Destination) ctx.lookup(queueName);

      QueueBrowser queueBrowser = qpidSession.createBrowser(queueRef);

      triggers =>
      java.lang.ClassCastException: org.apache.qpid.client.AMQAnyDestination cannot be cast to org.apache.qpid.client.AMQQueue
      at org.apache.qpid.client.AMQSession.createBrowser(AMQSession.java:963)
      at org.apache.qpid.client.AMQSession.createBrowser(AMQSession.java:950)

      The createBrowser call is part of JMS. However this part of the API cannot
      be used with Destinations defined using the addressing scheme.

        Attachments

          Activity

            People

            • Assignee:
              gemmellr Robbie Gemmell
              Reporter:
              lefthandmagic Praveen Murugesan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: