You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2013/04/16 14:21:16 UTC

[jira] [Commented] (CAMEL-6133) Logger destroyes SaxSource

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

Claus Ibsen commented on CAMEL-6133:
------------------------------------

The problem is that you log the body with
{code}
                        .log(LoggingLevel.WARN, "${body}")
{code}

That does output the message body as a String, which mean the data will be read. And as its stream based it cannot be re-read when you want to XSLT the message.

You can enable stream caching to support this.
http://camel.apache.org/stream-caching.html
                
> Logger destroyes SaxSource
> --------------------------
>
>                 Key: CAMEL-6133
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6133
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.4, 2.10.5
>            Reporter: Thomas 
>            Assignee: Claus Ibsen
>             Fix For: 2.11.0
>
>         Attachments: saxsource-test.zip
>
>
> Test case:
> To parse XHTML we use jtidy and a xslt script. The xslt component works in this case better when a SAXSource is used because the SAXSource can use it's own XMLReader with it's own CatalogResolver. 
> Problem:
> After transforming the body with xslt component the SAXSource is debug logged by _org.apache.camel.processor.SendProcessor_. This log will "destroy" the SAXSource resulting in an _premature end of file_. See http://www.danielschneller.com/2008/01/saxparseexception-1-1-premature-end-of.html
> Workaround:
> Switch log level of _SendProcessor_ to INFO or WARN or something else but not DEBUG.
> Logging in camel should clone SAXSource before reading.
> May be a problem by used logger framework? I use log4j.

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