Article View: borland.public.jbuilder.xml
Article #2SAX Parsing Error only on some servers
From: Rick Brandt
Date: Thu, 17 Jun 2004 20:22
Date: Thu, 17 Jun 2004 20:22
63 lines
3395 bytes
3395 bytes
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
Technical Details
Message-ID:
<2jecrpF1073gfU1@uni-berlin.de>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!fu-berlin.de!uni-berlin.de!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcb34,7e4b0de22356bd91,start X-Google-Attributes: gidfcb34,public Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Rick Brandt" <rickbrandt2@hotmail.com> Newsgroups: borland.public.jbuilder.xml Subject: SAX Parsing Error only on some servers Date: Thu, 17 Jun 2004 15:22:16 -0500 Lines: 65 Message-ID: <2jecrpF1073gfU1@uni-berlin.de> Reply-To: "Rick Brandt" <rickbrandt2@hotmail.com> X-Trace: news.uni-berlin.de XmCyeQPwGXt2vE21fhL0eg3RLcbewq+w0SF/YL5dzFjKkl9hA= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409