Uploaded image for project: 'WSS4J'
  1. WSS4J
  2. WSS-634

Nodes are not imported correctly when creating headers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.0, 2.2.2
    • 2.2.3, 2.3.0
    • WSS4J Core
    • None
    • Patch

    Description

      When using WS Security with Spring Boot 2.1RC1 on Java 11, I get an error:

      org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
      at java.xml/com.sun.org.apache.xerces.internal.dom.ParentNode.internalInsertBefore(ParentNode.java:356)
      at java.xml/com.sun.org.apache.xerces.internal.dom.ParentNode.insertBefore(ParentNode.java:287)

      Tracing the issue, the root cause is that 

      ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java tries to create and import nodes, but doesn't actually import them.

      I've seen this issue on 2.2.0 and 2.2.2.

      Attached patch properly imports the newly created nodes, eliminating the issue.  The patch is against 2.2.2.

      Attachments

        1. wss4j-2.2.2.patch
          0.5 kB
          Michael Westergaard

        Activity

          People

            coheigea Colm O hEigeartaigh
            klafbang Michael Westergaard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: