🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.xml
2 messages
2 total messages Started by Rick Brandt Thu, 17 Jun 2004 20:22
SAX Parsing Error only on some servers
#2
Author: Rick Brandt
Date: Thu, 17 Jun 2004 20:22
63 lines
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
Re: SAX Parsing Error only on some servers
#3
Author: Tor Iver Wilhelmsen (TeamB)
Date: Sun, 27 Jun 2004 16:03
19 lines
1636 bytes
On Thu, 17 Jun 2004 15:22:16 -0500, Rick Brandt <rickbrandt2@hotmail.com>  
wrote:

> 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 would look into differences in the versions of the parsers used. Do you  
use e.g. the Xerces shipping with JBuilder 7 when running there while  
using the Xerces in the (assumed newer) Tomcat installations when it fails?



-- 
Tor Iver Wilhelmsen
TeamB
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads