Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-19105

XML collection input with attributes fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • camel-quarkus-2.Next-GA
    • camel-quarkus-2.2-GA
    • Atlas Map
    • None
    • False
    • None
    • False
    • % %
    • Todo
    • Hide

      Download the provided Camel Quarkus project and run with:

      ./mvnw clean compile quarkus:dev

      The execution should throw the following warning/error messages:

      2022-05-17 10:33:38,937 WARN  [io.atl.cor.ADMArchiveHandler] (Camel (quarkus-camel-example-xml) thread #0 - timer://main) Invalid serialized mapping definition content detected, discarding
      2022-05-17 10:33:38,937 WARN  [io.atl.cor.DefaultAtlasContext] (Camel (quarkus-camel-example-xml) thread #0 - timer://main) AtlasMap context cannot initialize without mapping definition, ignoring: Mapping URI=null
      2022-05-17 10:33:38,940 ERROR [org.apa.cam.pro.err.DefaultErrorHandler] (Camel (quarkus-camel-example-xml) thread #0 - timer://main) Failed delivery for (MessageId: 306CB9D89227C58-0000000000000000 on ExchangeId: 306CB9D89227C58-0000000000000000). Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException
      

       

      Show
      Download the provided Camel Quarkus project and run with: ./mvnw clean compile quarkus:dev The execution should throw the following warning/error messages: 2022-05-17 10:33:38,937 WARN  [io.atl.cor.ADMArchiveHandler] (Camel (quarkus-camel-example-xml) thread #0 - timer: //main) Invalid serialized mapping definition content detected, discarding 2022-05-17 10:33:38,937 WARN  [io.atl.cor.DefaultAtlasContext] (Camel (quarkus-camel-example-xml) thread #0 - timer: //main) AtlasMap context cannot initialize without mapping definition, ignoring: Mapping URI= null 2022-05-17 10:33:38,940 ERROR [org.apa.cam.pro.err.DefaultErrorHandler] (Camel (quarkus-camel-example-xml) thread #0 - timer: //main) Failed delivery for (MessageId: 306CB9D89227C58-0000000000000000 on ExchangeId: 306CB9D89227C58-0000000000000000). Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException  

      Given the following XML input data shape:

      <Products>
          <item id="i-001">3</item>
          <item id="i-002">10</item>
      </Products>

      And given the following target data shape:

      {"items": [
          {
              "id": "i-001",
              "quantity": 3
          },
          {
              "id": "i-002",
              "quantity": 10
          }
      ]}

      AtlasMap will succeed to map the collection if only the item's XML value is mapped, but fails when the attribute is also mapped.

      The expectation is that AtlasMap succeeds to map the XML collection, mapping the XML id attribute into the JSON id field, and mapping the XML item's value to the JSON quantity field.

              toigaras@redhat.com tomohisa igarashi
              bmesegue@redhat.com Bruno Meseguer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: