SAX Parsing Error only on some servers

Rick Brandt

Usenet Archive
Joined
Jun 18, 2004
Messages
66
Reaction score
0
I send an XML character stream to a Java servlet with an HTTPRequest and get the following error on both of our web servers hosting the servlet.

org.xml.sax.SAXParseException: The root element is required in a well-formed document.

If I send the exact same request to my local instance of the servlet running in JBuilder's IDE it parses just fine which is making this a real bitch to troubleshoot. (JBuilder 7)

I have my WAR file including ALL classes and resources that pertain to XML and it makes no difference.

Here is the XML I am sending...

<?xml version="1.0"?>
<MBO>
<Record>
<ID>1086379850</ID>
<OrderDate><![CDATA[2004-06-04 15:10:50]]></OrderDate>
<MemoBillType>5</MemoBillType>
<AccountNum><![CDATA[xxxx]]></AccountNum>
<BillToAddress><![CDATA[sample company name[LINE]blah blah blah[LINE]123 main street[LINE]Anytown MO 63366]]></BillToAddress> <ShipToAddress><![CDATA[Same as Bill To Address]]></ShipToAddress> <RegMgr><![CDATA[Joe Blow / RD]]></RegMgr> <SecCode><![CDATA[999999-999999]]></SecCode> <Notes><![CDATA[NULL_VALUE]]></Notes> <RequireDate><![CDATA[Whenever ready]]></RequireDate> <RackInfo><![CDATA[NULL_VALUE]]></RackInfo> <CallPhoneNumber><![CDATA[NULL_VALUE]]></CallPhoneNumber> <SubRecord_A> <LineNum>1</LineNum> <Quantity>1</Quantity> <PartNum><![CDATA[123-456-789]]></PartNum> <ShipDesignation><![CDATA[NULL_VALUE]]></ShipDesignation> <Price>NULL_VALUE</Price> <Discount><![CDATA[NULL_VALUE]]></Discount> <Notes><![CDATA[HDT frame off set measuring tool. This is ordered to replace broken tool. Old tool will be returned upon receipt of replacement.]]></Notes> </SubRecord_A> </Record> </MBO>

If the text in the last <Notes> node is shortened to less than 32 characters it will submit on my servers. I can't understand what is happening unless the XML that is being received is somehow altered compared to the XML being sent. I have similar operations where the text in a node is much longer than this and have never had any problems.

Any idea what I should be looking for? This program has been in use for a couple of years without this complaint. I have one user that reported the problem which I was able to duplicate using the same data sending from a client on my PC, but I have similar records that submit just fine. I can also copy the XML into a local file and my web browser sees no problems with it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top