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

camel-jaxb with camel-cxf: fails to unmarshal after changes in TypeConverter logic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Information Provided
    • 4.4.1
    • 4.x
    • camel-jaxb
    • None
    • Unknown
    • Regression

    Description

      When upgrading a JAXB+CXF application from Camel 4.x to Camel 4.4.x we encountered a `jakarta.xml.bind.UnmarshalException` with a linked exception of `com.sun.istack.SAXParseException2` Namespace URIs and local names to the unmarshaller needs to be interned.

      Through bisection, we believe this change happens after the changes in Camel-14028 . 

      When the inbound data in a CxfCachedPayload object is converted with the new non-stream cast unmarshal(), the method attempts to find a TypeConverter fail repeatedly until a fallback CXF converter is found that instantiates a WstxDOMWrappingReader (instance of XmlStreamReader) - however this one has a flag _cfgInternNames set to false which causes the exception above to be thrown.

       

      When we force the code to flow into the old InputStream path, we end up in `camel.converter.jaxp` where factory methods create a ValidatingStreamReader (instance of XmlStreamReader) to read a ByteArrayInputStream.

       

      The latter object contains the flag mInternStrings=true and works as in previous iterations of Camel.

       

      To continue working as before, the WstxDOMWrappingReader needs interning to be activated or have the CXFCachedPayload handled by the jaxp logic

      Attachments

        1. export.tar.gz
          7 kB
          Billy Jaime Beltran

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              chrysophylax Billy Jaime Beltran
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: