By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

SAX Parsing Error only on some servers

P: n/a
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.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.