cancel
Showing results for 
Search instead for 
Did you mean: 

JCO_ERROR_XML_PARSER

Former Member
0 Kudos

Hello everyone,

first I know that there is another thread regarding JCO_ERROR_XML_PARSER on /message/3284879#3284879 [original link is broken] but as it is in the portal section while my problem isn't a portal issue I decided to post it here in the Java section. Hope that's alright.

Ok let's start. I'm getting a JCO_ERROR_XML_PARSER exception when calling a functional module in R/3. Below you can see the exception I'm getting in Java.

[code]com.sap.mw.jco.JCO$Exception: (130) JCO_ERROR_XML_PARSER: Expecting a tag to begin with '<' instead of '0', in "58320050310"

at com.sap.mw.jco.util.XMLReaderBase.nextTag(XMLReaderBase.java:247)

at com.sap.mw.jco.util.XMLReaderBase.nextTag(XMLReaderBase.java:228)

at com.sap.mw.jco.util.XMLReaderBase.nextElement(XMLReaderBase.java:428)

at com.sap.mw.jco.util.XMLReaderBase.nextStatement(XMLReaderBase.java:216)

at com.sap.mw.jco.util.XMLReaderBase.nextElement(XMLReaderBase.java:412)

at com.sap.mw.jco.util.XMLReaderBase.nextStatement(XMLReaderBase.java:216)

at com.sap.mw.jco.util.XMLReaderBase.parse(XMLReaderBase.java:110)

at com.sap.mw.jco.util.XMLReaderBase.parse(XMLReaderBase.java:92)

at com.sap.mw.jco.JCO$Record.fromXML(JCO.java:13192)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)

at [...].sap.function.r3.Z_FUNCTIONS_ZFUBEL01.execute(Z_FUNCTIONS_ZFUBEL01.java:166)[/code]

When I check the relevant position in my trace file I can see the following XML tag structure, but no malformed XML code.

[code]<T_OUTPUT>

<item>

<LINE>0056114100Paid2005KC461416814020050103200502274652059906 460904158320050310.....um41729096/020/AMWEST CONTR41729096020</LINE>

</item>

...[/code]

In R/3 I'm almost getting the same result/output except of one little difference (in Java I get . instead of # right after the position that JCO claims to be faulty).

<code>0056114100Paid2005KC461416814020050103200502274652059906 460904158320050310#####um41729096/020/AMWEST CONTR41729096020</code>

At the moment I'm stuck. Does anyone have a clue what is going wrong?

Any help is appreciated.

Frieder

Message was edited by:

Frieder Heugel

Accepted Solutions (0)

Answers (1)

Answers (1)

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Frieder,

Whether your BAPI has nested structure? try to avoid deep structures.

Regards, Suresh KB

Former Member
0 Kudos

Hi Suresh,

Thank you for your reply but unfortunately we are not using any nested/deep structures in the SAP R/3 function. The export parameter is a table type of type SO_TXTTAB and contains row types of type SQLI (LINE = Char 255).

Therefore I should only get a String with a maximum character number of 255.

Do you or anyone else have any more hints? Thank you guys in advance for your help.

Cheers

Frieder

ravi_raman2
Active Contributor
0 Kudos

Try to validate the xml against an xsd, seems to be an xml parser implementation issue.......

Regards

Ravi Raman

Former Member
0 Kudos

Hi Suresh,

We finally found the reason why the parsing of the XML content failed. There was a packed number (P) within the export parameter string. Obviously JCo can't deal with that although it is an elementary type.

Thank you both for your suggestions.

Frieder