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

Pre-XSLT and Validator Type Conversions from byte[] may easily fail

    XMLWordPrintableJSON

Details

    • Unknown
    • Regression

    Description

      XsltBuilder.getSource(Exchange e, Object o) tries to convert the payload to a Source.

      If you have a byte[] payload, then the following type converter will likely be picked:

      InstanceMethodTypeConverter: public javax.xml.transform.sax.SAXSource 
      org.apache.camel.converter.jaxp.XmlConverter.toSAXSource(byte[],org.apache.camel.Exchange) 
      throws java.io.IOException,org.xml.sax.SAXException,javax.xml.transform.TransformerException
      

      This type converter requires the Exchange (InstanceMethodTypeConverter.useExchange == true), but line 461 of XsltBuilder doesn't pass it on.

      Therefore, a NullPointerException happens because the conversion method tries to access the Exchange.

      Attachments

        Issue Links

          Activity

            People

              njiang Willem Jiang
              raulvk Raúl Kripalani
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: