[ 
https://issues.apache.org/jira/browse/CAMEL-6020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13566186#comment-13566186
 ] 

Willem Jiang commented on CAMEL-6020:
-------------------------------------

The issue is caused by there are bunches of type converter which can turn a 
byte into a Source. The result could be StreamSource or StaxSource or 
ByteSource.
Because these converters are loaded in different sequence when camel is loading 
the converter, so we hit this kind of issue.

To fix the issue, I just changed the type converter calling sequence to make 
sure we get the exact Source object we want first.
                
> Camel Transformer using inconsistent sources
> --------------------------------------------
>
>                 Key: CAMEL-6020
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6020
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.3
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>             Fix For: 2.10.4, 2.11.0
>
>
> I have a simple xml transformer:
> {code}
> <camel:camelContext id="camelContext" trace="true">
> <camel:route id="testRoute">
> <camel:from uri="direct:testEndpoint" />
> <camel:process ref="testProcessor" />
> <camel:marshal>
> <camel:jaxb fragment="true" partClass="test.Talk" contextPath="test"
> partNamespace="{http://test/}talk"/>
> </camel:marshal>
> <camel:to uri="log:TEST-AFTER-MARSHALL" />
> <camel:to 
> uri="xslt:xslt/transform.xsl?transformerFactory=saxonTransformerFactory" />
> <camel:to uri="log:TEST-AFTER-XSL" />
> </camel:route>
> </camel:camelContext>
> {code}
> The xslt is very simple then:
> {code}
> <xsl:template match="/">
> <afterXlst>
> <xsl:value-of select="test:talk/text" />
> </afterXlst>
> </xsl:template>
> {code}
> With this example run multiple times (3 in the cases below), I'm seeing 
> inconsistent inconsistent transformers being used with 2.10.3 and also 2.11 
> SNAPSHOT:
> {code}
> wildflower:test-bundle $ tail -f output.log | grep "XsltBuilder TRACE Using"
> 2013-01-17 11:37:59,201 [ main] XsltBuilder TRACE Using BytesSource[
> 2013-01-17 11:37:59,201 [ main] XsltBuilder TRACE Using BytesSource[
> 2013-01-17 11:37:59,201 [ main] XsltBuilder TRACE Using BytesSource[
> 2013-01-17 11:38:18,664 [ main] XsltBuilder TRACE Using 
> javax.xml.transform.stream.StreamSource@4af6fd54 as source
> 2013-01-17 11:38:18,664 [ main] XsltBuilder TRACE Using 
> javax.xml.transform.stream.StreamSource@4af6fd54 as source
> 2013-01-17 11:38:18,664 [ main] XsltBuilder TRACE Using 
> javax.xml.transform.stream.StreamSource@4af6fd54 as source
> 2013-01-17 11:38:38,241 [ main] XsltBuilder TRACE Using 
> javax.xml.transform.stax.StAXSource@23f95cce as source
> 2013-01-17 11:38:38,241 [ main] XsltBuilder TRACE Using 
> javax.xml.transform.stax.StAXSource@23f95cce as source
> 2013-01-17 11:38:38,241 [ main] XsltBuilder TRACE Using 
> javax.xml.transform.stax.StAXSource@23f95cce as source
> {code}

--
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

Reply via email to