Aki Yoshida created CAMEL-6408: ---------------------------------- Summary: cxf endpoint's should log the parsing exception when failing to extract the root element name Key: CAMEL-6408 URL: https://issues.apache.org/jira/browse/CAMEL-6408 Project: Camel Issue Type: Improvement Components: camel-cxf Affects Versions: 2.10.4 Reporter: Aki Yoshida Priority: Trivial Attachments: camel-cxf-20130531.txt
When the content is not xml and the root element is not correctly extracted by the CxfEndpoint's root element extraction method, the original exception is not logged but a subsequent exception (not the original one) will be thrown upwards. This behavior is confusing and could potentially lead to another issue depending on what the stax parser does on its getLocalName(). Currently, when r.next() throws an exception, it's ignored and the subsequent call to r.getLocalName()'s exception is thrown. So I think it's preferable to log the original exception and simply return null as in the other cases for not finding the root element. Logging the original exception will provide a more helpful information in spotting the issue, as it will show up like: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'c' (code 99) in prolog; expected '<' This is an action to the point raised in http://camel.465427.n5.nabble.com/Test-route-with-CXF-endpoint-td5733266.html -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira