Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6922

XmlConverter cannot convert from ElementNSImpl to Document

    XMLWordPrintableJSON

Details

    • Novice

    Description

      XmlConvertor cannot convert from org.apache.xerces.dom.ElementNSImpl to org.w3c.dom.Document. Class ElementNSImpl implements both interfaces org.w3c.dom.Node and org.w3c.dom.NodeList. While type converter lookup iterates from ElementNSImpl through it's superclasses and implemented interfaces, it reaches NodeList first. Therefore the

      Node toDOMNodeFromSingleNodeList(NodeList)

      method is selected for conversion. However this method returns null for any NodeList with more than one node. This leads to null in a message's body.
      This issue is not detected on Linux, because on Oracle JDK lookup reaches Node before NodeList and the

      Document toDOMDocument(Node)

      method is selected for conversion.

      Attachments

        1. patchfile.txt
          0.8 kB
          Rene Avontuur
        2. NodeListToDocumentTest.java
          2 kB
          Rene Avontuur

        Activity

          People

            davsclaus Claus Ibsen
            arseniy Arseniy Tashoyan
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: