Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 99930 invoked from network); 5 Nov 2008 14:30:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Nov 2008 14:30:18 -0000 Received: (qmail 26718 invoked by uid 500); 5 Nov 2008 14:30:24 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 26002 invoked by uid 500); 5 Nov 2008 14:30:23 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 25991 invoked by uid 99); 5 Nov 2008 14:30:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2008 06:30:23 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2008 14:29:02 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 847F2234C278 for ; Wed, 5 Nov 2008 06:29:44 -0800 (PST) Message-ID: <1653519580.1225895384508.JavaMail.jira@brutus> Date: Wed, 5 Nov 2008 06:29:44 -0800 (PST) From: "Peter Storch (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Created: (AXIS2-4124) CLONE -Exception in XML serialization causes malformed/corrupted response MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org CLONE -Exception in XML serialization causes malformed/corrupted response ------------------------------------------------------------------------- Key: AXIS2-4124 URL: https://issues.apache.org/jira/browse/AXIS2-4124 Project: Axis 2.0 (Axis2) Issue Type: Bug Components: kernel Affects Versions: 1.2, 1.1.1 Environment: Windows Vista, Tomcat 5.5.20, JDK 1.5.0_10 Reporter: Peter Storch Assignee: Glen Daniels Priority: Blocker Fix For: 1.3 Hi there, We have a simple SOAP layer that returns data pulled from the DB using Axis= . Nothing special here. In our testing, one of the objects happened to have an invalid XML 1.0 char= acter (0x10) in its description field. As it's not an application Fault (o= ur application currently doesn't check for it. It no doubt should, obvious= ly), Axis2 wasn't aware of it until it's notified by the Woodstox Buffering= XMLWriter of an invalid character (through IOException). Axis2 caught the = exception (at , and raised an AxisFault. It then proceeded to send the Fau= lt as its own message (envelope) back to the client. All is well, except t= hat Axis2 was in the middle of writing out response provided by the busines= s application. That led to a corrupted byte stream that contained a partia= l, not well-formed envelope, followed immediately by the Fault envelope. S= omething to the effect of a purging (not flushing) to clear the output stre= am before sending out the Fault message would seem desirable. It may not be so bad if the client receives such a corrupted stream, and th= rows some sort of error. The Fault message becomes meaningless, obviously,= which isn't great either. But, what's worse is that the Axis2 client (Ser= viceClient.sendReceive) actually was able to parse the corrupted byte strea= m, and somehow considered the Fault message be the content of the last XML = element that contained the invalid character. Now, that's really bad. This may have been logged in JIRA, but I couldn't seem to find it. -Alan Stack track of the exception caught by Axis2 during serialization: com.ctc.wstx.exc.WstxIOException: Invalid white space character (0x10) in = text to output =09at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.jav= a:520) =09at org.apache.axiom.om.impl.llom.OMTextImpl.writeOutput(OMTextImpl.java:= 209) =09at org.apache.axiom.om.impl.llom.OMTextImpl.internalSerializeLocal(OMTex= tImpl.java:368) =09at org.apache.axiom.om.impl.llom.OMTextImpl.internalSerialize(OMTextImpl= .java:197) =09at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMEleme= ntImpl.java:766) =09at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMEleme= ntImpl.java:750) =09at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMEleme= ntImpl.java:766) =09at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMEleme= ntImpl.java:750) =09at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMEleme= ntImpl.java:766) =09at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(= OMSourcedElementImpl.java:564) =09at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMEleme= ntImpl.java:750) =09at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(= OMSourcedElementImpl.java:551) =09at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.serialize(OMSource= dElementImpl.java:592) =09at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.ja= va:907) =09... 30 more Caused by: java.io.IOException: Invalid white space character (0x10) in tex= t to output =09at com.ctc.wstx.sw.XmlWriter.throwInvalidChar(XmlWriter.java:545) =09at com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter= .java:453) =09at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.jav= a:518) =09... 43 more This is the call stack from Eclipse debugger: CoyoteOutputStream.write(byte[], int, int) line: 88=09 UTF8Writer.flush() line: 96=09 BufferingXmlWriter.flush() line: 214=09 SimpleNsStreamWriter(BaseStreamWriter).flush() line: 311=09 MTOMXMLStreamWriter.flush() line: 115=09 SOAPEnvelopeImpl(OMNodeImpl).serializeAndConsume(OutputStream, OMOutputForm= at) line: 419=09 SOAPMessageFormatter.writeTo(MessageContext, OMOutputFormat, OutputStream, = boolean) line: 55=09 CommonsHTTPTransportSender.sendUsingOutputStream(MessageContext, OMOutputFo= rmat) line: 275=09 CommonsHTTPTransportSender.invoke(MessageContext) line: 203=09 AxisEngine.sendFault(MessageContext) line: 533=09 AxisServlet.handleFault(MessageContext, OutputStream, AxisFault) line: 393= =09 AxisServlet.processAxisFault(MessageContext, HttpServletResponse, OutputStr= eam, AxisFault) line: 355=09 AxisServlet.doPost(HttpServletRequest, HttpServletResponse) line: 152=09 AxisServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) l= ine: 709=09 AxisServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 802= =09 ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) li= ne: 252=09 ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 173= =09 HibernateFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line= : 95=09 ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) li= ne: 202=09 ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 173= =09 StandardWrapperValve.invoke(Request, Response) line: 213=09 StandardContextValve.invoke(Request, Response) line: 178=09 StandardHostValve.invoke(Request, Response) line: 126=09 ErrorReportValve.invoke(Request, Response) line: 105=09 FastCommonAccessLogValve.invoke(Request, Response) line: 495=09 StandardEngineValve.invoke(Request, Response) line: 107=09 CoyoteAdapter.service(Request, Response) line: 148=09 Http11Processor.process(InputStream, OutputStream) line: 869=09 Http11Protocol$JmxHttp11ConnectionHandler(Http11BaseProtocol$Http11Connecti= onHandler).processConnection(TcpConnection, Object[]) line: 664=09 PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line: 527=09 LeaderFollowerWorkerThread.runIt(Object[]) line: 80=09 ThreadPool$ControlRunnable.run() line: 684=09 ThreadWithAttributes(Thread).run() line: 595=09 What got sent over the wire back to the client: <= ns2:getSKUListResponse xmlns:ns2=3D"http://mds.adserver.massive.com/xsd">2005-09-20T19:56:21.000Zx512005-09-23T17:51:37.000ZEveryoneSKUtrue2005-09-20T19:55:23.000= Zsoapenv:Client= Invalid white space character (0x10) in text to output What the client (Axis2 ServiceClient) thought it was getting: <= ns2:getSKUListResponse xmlns:ns2=3D"http://mds.adserver.massive.com/xsd">2005-09-20T19:56:21.000Zx512005-09-23T17:51:37.000ZEveryoneSKUtrue2005-09-20T19:55:23.000= Z version=3D'1.0' encoding=3D'UTF-8'?>soapenv:ClientInva= lid white space character (0x10) in text to output<= /soapenv:Fault> --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org