|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Invalid XML character in the prolog |
« View previous topic :: View next topic » |
Author |
Message
|
ghoshly |
Posted: Wed Apr 02, 2014 1:31 am Post subject: Invalid XML character in the prolog |
|
|
Partisan
Joined: 10 Jan 2008 Posts: 333
|
Hello,
We have faced RecoverableException rarely in a webservice scenario while processing the response. Need your guidance to understand and capture further details about the exception to resolve.
Environment: WMB - 8.0.0.2 in AIX 7.1 . Source: SAP, Target: .Net application.
ExceptionList:
Code: |
<RecoverableException>
<File>/build/slot1/S800_P/src/WebServices/WSLibrary/ImbSOAPRequestHelper.cpp</File>
<Line>2263</Line>
<Function>ImbSOAPRequestHelper::makeSOAPRequest</Function>
<Type/>
<Name/>
<Label/>
<Catalog>BIPmsgs</Catalog>
<Severity>3</Severity>
<Number>3701</Number>
<Text>Error Making JNI Call: Axis2Requester_processResponseMessageSync</Text>
<Insert>
<Type>5</Type>
<Text>Axis2Requester_processResponseMessageSync</Text>
</Insert>
<Insert>
<Type>5</Type>
<Text>org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document.</Text>
</Insert>
<Insert>
<Type>5</Type>
<Text>Frame : 0 org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document.| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:255)| @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:157)| @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:106)| @: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:2220)| @: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1920)| @: com.ibm.broker.axis2.Axis2Requester.processResponseMessageSync(Axis2Requester.java:2166)|Frame : 1 javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document.| @: com.ibm.xml.xlxp2.api.stax.msg.StAXMessageProvider.throwWrappedXMLStreamException(StAXMessageProvider.java:76)| @: com.ibm.xml.xlxp2.api.stax.XMLStreamReaderImpl.produceFatalErrorEvent(XMLStreamReaderImpl.java:2013)| @: com.ibm.xml.xlxp2.api.jaxb.JAXBXMLStreamReader.produceFatalErrorEvent(JAXBXMLStreamReader.java:316)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.reportFatalError(DocumentScanner.java:4821)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.reportFatalError(DocumentScanner.java:1205)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.scanProlog(DocumentScanner.java:1770)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.nextEvent(DocumentScanner.java:1316)| @: com.ibm.xml.xlxp2.api.stax.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:586)| @: com.ibm.xml.xlxp2.api.stax.XMLInputFactoryImpl$XMLStreamReaderProxyImpl.next(XMLInputFactoryImpl.java:183)| @: com.ibm.xml.xlxp2.api.wssec.WSSXMLInputFactory$WSSStreamReaderProxy.next(WSSXMLInputFactory.java:55)| @: org.apache.axiom.om.impl.builder.StAXBuilder.parserNext(StAXBuilder.java:567)| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.nextToken(StAXOMBuilder.java:634)| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:175)| @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:157)| @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:106)| @: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:2220)| @: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1920)| @: com.ibm.broker.axis2.Axis2Requester.processResponseMessageSync(Axis2Requester.java:2166)</Text>
</Insert>
</RecoverableException> |
We got to know about valid XML characters
Quote: |
http://www.w3.org/TR/2006/REC-xml-20060816/#charsets
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */ |
Hence I believe 0x45 is not a invalid XML character, but as it is present in the prolog which is not expected, it is throwing error. Please correct me if I am wrong.
If possible, would you please guide me to find the reason why that character is present in prolog / how that character got inserted which is causing exception. |
|
Back to top |
|
 |
mqsiuser |
Posted: Wed Apr 02, 2014 2:47 am Post subject: Re: Invalid XML character in the prolog |
|
|
 Yatiri
Joined: 15 Apr 2008 Posts: 637 Location: Germany
|
ghoshly wrote: |
in the prolog |
This is just "elevated" language... they could have also written "at the beginning of your (xml) file".
Before the root element (the single one root element of your xml) the only thing allowed is the "xml declaration"
(ok, and a BOM and MQMD, MQRFH2, and other things may be also, that get properly handled)
Everything else, especially some (random) characters is not allowed and will just be invalid xml (and cause an exception/rejection).
That's how xml works: The sending application must make sure to send valid xml...
... ofc... something may happen that your file gets "altered"/corrupted (at the beginning (or all over the place - just throwing the error at the beginning)) esp. when not using mq(-server) _________________ Just use REFERENCEs |
|
Back to top |
|
 |
kimbert |
Posted: Wed Apr 02, 2014 3:25 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
The error specifically says:
Code: |
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document. |
This is an XML parser error. It is issued by the XML parser embedded in the JVM and called by the Axiom SOAP processing stack.
The most likely reason is that the XML parser has been told to use the wrong encoding. A quick Google search suggests that the parser is using UTF-16 when the XML document is actually encoded as UTF-8. Or maybe the other way around. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
ghoshly |
Posted: Wed Apr 02, 2014 8:30 am Post subject: prod environment |
|
|
Partisan
Joined: 10 Jan 2008 Posts: 333
|
The environment is PROD. I do not have idea about the control, the target app is having. The the day, we received this error couple of time, may had network issue as well. Is there a way we can reproduce the same? |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|