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

Unhandled ClassCastException if fault detail is not JaxbElement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.19.0
    • camel-soap
    • None
    • Unknown

    Description

      Hi,

      I've been having some issues with handling some SOAP faults that come in with a detail message that is undefined in their WSDL, the result is that they end up as xerces dom elements rather than JAXBElements.

      I end up with a pretty ugly message that looks like this :

      java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to javax.xml.bind.JAXBElement
      	at org.apache.camel.dataformat.soap.Soap11DataFormatAdapter.createExceptionFromFault(Soap11DataFormatAdapter.java:195)
      	at org.apache.camel.dataformat.soap.Soap11DataFormatAdapter.doUnmarshal(Soap11DataFormatAdapter.java:170)
      	at org.apache.camel.dataformat.soap.SoapJaxbDataFormat.unmarshal(SoapJaxbDataFormat.java:287)
      	at org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:69)
      	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:460)
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
      

      It's pretty had to intercept this in the pipeline, so at the moment I've handled parsing the response myself rather than the soap dataformat, but I would like to avoid this in the future as it does require a bit of custom code.

      I'll create a PR that demonstrates what I believe is a reasonable workaround.

      Cheers,
      Daniel

      Attachments

        Issue Links

          Activity

            People

              zregvart Zoran Regvart
              dfullarton Daniel Fullarton
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: