[
https://issues.apache.org/jira/browse/CXF-4475?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Freeman Fang resolved CXF-4475.
-------------------------------
Resolution: Fixed
commit fix
http://svn.apache.org/viewvc?rev=1373240&view=rev for trunk
http://svn.apache.org/viewvc?rev=1373704&view=rev for 2.6.x branch
http://svn.apache.org/viewvc?rev=1373720&view=rev for 2.5.x branch
http://svn.apache.org/viewvc?rev=1373720&view=rev for 2.4.x branch
> LoggingInInterceptor throws when pretty printing MTOM messages
> --------------------------------------------------------------
>
> Key: CXF-4475
> URL: https://issues.apache.org/jira/browse/CXF-4475
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.6.1
> Reporter: aaron pieper
> Assignee: Freeman Fang
> Priority: Minor
> Labels: logging, xml
>
> I'm using CXF to implement some SOAP web services. I've added a
> LoggingInInterceptor to my interceptor chain through an XML configuration
> file so that incoming SOAP messages will be logged. My configuration file
> looks like this:
> --------------------
> <jaxws:endpoint id="foo" implementor="#fooServiceImpl" address="/FOO">
> <!-- snip... -->
> <jaxws:inInterceptors>
> <ref bean="loggingInInterceptor"/>
> <!-- snip... -->
> </jaxws:endpoint>
>
> <bean id="loggingInInterceptor"
> class="org.apache.cxf.interceptor.LoggingInInterceptor">
> <property name="prettyLogging" value="true"/>
> </bean>
> --------------------
> This logging setup works OK for non-MTOM messages. But when an incoming
> message uses MTOM, I get an error:
> --------------------
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
> at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:425)
> at net.sf.saxon.event.Sender.send(Sender.java:178)
> at
> net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:39)
> at
> org.apache.cxf.interceptor.AbstractLoggingInterceptor.writePayload(AbstractLoggingInterceptor.java:158)
> at
> org.apache.cxf.interceptor.LoggingInInterceptor.logging(LoggingInInterceptor.java:152)
> --------------------
> The pretty-printing logic in AbstractLoggingInterceptor requires the message
> to be well-formed XML, but MTOM messages have various non-XML headers and
> boundaries. The "content not allowed in prolog" comes from
> AbstractLoggingInterceptor trying to parse one of these boundaries as XML.
> I've been able to work around this problem by disabling pretty printing.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira