Qpid
  1. Qpid
  2. QPID-4929

[Java AMQP 1.0 Client] Infinite recursion attempting to write DeliveryAnnotations

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.23
    • Component/s: Java Client
    • Labels:
      None

      Description

      Reported by Brian: http://qpid.2158936.n2.nabble.com/StackOverflowError-when-building-AMQP-message-td7594137.html#none

      Hi,

      I am new to AMQP 1.0. I was tried to write a simple AMQP sender in Java and I got the following error

      java.lang.StackOverflowError
      at org.apache.qpid.amqp_1_0.codec.UnsignedLongWriter$2.convertToByte(UnsignedLongWriter.java:65)
      at org.apache.qpid.amqp_1_0.codec.UnsignedLongWriter$2.convertToByte(UnsignedLongWriter.java:1)
      at org.apache.qpid.amqp_1_0.codec.FixedOneWriter.setValue(FixedOneWriter.java:75)
      at org.apache.qpid.amqp_1_0.codec.UnsignedLongWriter.setValue(UnsignedLongWriter.java:139)
      at org.apache.qpid.amqp_1_0.codec.UnsignedLongWriter.setValue(UnsignedLongWriter.java:1)
      at org.apache.qpid.amqp_1_0.type.codec.AMQPDescribedTypeRegistry.getValueWriter(AMQPDescribedTypeRegistry.java:362)
      at org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter.createDescriptorWriter(AbstractDescribedTypeWriter.java:1

      This error only occurred when I tried to create DeliveryAnnotations object. If I don't create DeliveryAnnotations object, it works fine.

      My code is

      Collection<Section> sections = new ArrayList<Section>();

      Map map = new HashMap<String, String>();
      map.put("da_key", "da_val");
      DeliveryAnnotations da = new DeliveryAnnotations(map);
      sections.add(da);

      Data data = new Data(new Binary(("hello world").getBytes()));
      sections.add(data);

      Message myMessage = new Message(sections);

      mySender.send(myMessage);

        Activity

          People

          • Assignee:
            Rob Godfrey
            Reporter:
            Rob Godfrey
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development