Billy Jaime Beltran created CAMEL-20854:
-------------------------------------------

             Summary: camel-jaxb fails to unmarshal after changes in 
TypeConverter logic
                 Key: CAMEL-20854
                 URL: https://issues.apache.org/jira/browse/CAMEL-20854
             Project: Camel
          Issue Type: Bug
          Components: camel-jaxb
    Affects Versions: 4.4.1
            Reporter: Billy Jaime Beltran


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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to