[jdom-interest] Problems Creating a Document

Hunter Hillegas timebomb at west.net
Thu Nov 29 09:54:53 PST 2001


I'll try to see if can change it...

I am running everything inside Jboss and since the XML parser is used by a
lot of other system components, changing it out could cause other problems,
no?

Hunter

> From: Laurent Bihanic <laurent.bihanic at atosorigin.com>
> Date: Thu, 29 Nov 2001 18:50:38 +0100
> To: Hunter Hillegas <timebomb at west.net>
> Cc: JDOM-Interest mailing list <jdom-interest at jdom.org>
> Subject: Re: [jdom-interest] Problems Creating a Document
> 
> 
> Well, it's worth trying using Xerces (1.4.3 is OK) anyway. If the problem
> disappears, it may be that UPS have this "byte order" header at the top of the
> file (usually 2 characters 0xFFFE or OxFEFF according to the byte order
> encoding chosen).
> 
> Laurent
> 
> Hunter Hillegas wrote:
> 
>> No, MacOS X... Yes Crimson... No Notepad. It is coming in from an
>> InputStream from a https URL.
>> 
>> 
>>> From: Laurent Bihanic <laurent.bihanic at atosorigin.com>
>>> Date: Thu, 29 Nov 2001 10:11:04 +0100
>>> To: Hunter Hillegas <timebomb at west.net>
>>> Subject: Re: [jdom-interest] Problems Creating a Document
>>> 
>>> 
>>> Here's the answer I sent for a similar problem:
>>> 
>>> 
>>>> Questions :
>>>> - Are you on Windows ?
>>>> - Are you using Crimson ?
>>>> - Did you edit the XML file with Notepad and save it as Unicode or UTF-8 ?
>>>> 
>>>> If you answered three times "yes", switch to Xerces as this parser
>>>> detects the encoding header Notepad inserts while Crimson doesn't.
>>>> 
>>>> 
>>> 
>>> Hunter Hillegas wrote:
>>> 
>>> 
>>>> Hello. I am somewhat new to JDOM. I have used it several times for small
>>>> projects but now I am trying to use it in a J2EE project and I'm having
>>>> some
>>>> trouble...
>>>> 
>>>> Basically I am getting this exception:
>>>> 
>>>> org.jdom.JDOMException: Error on line 1: Document root element is missing.
>>>> 
>>>> This is how I'm setting up my JDOM session:
>>>> 
>>>> InputStream in = urlCon.getInputStream();
>>>> SAXBuilder builder = new SAXBuilder();
>>>> Document doc = builder.build(in);
>>>> Element docRoot = doc.getRootElement(); //get the root
>>>> 
>>>> I have verified that the InputStream does seem to have access to valid XML
>>>> that looks like this:
>>>> 
>>>> <?xml version="1.0"?>
>>>> <RatingServiceSelectionResponse>
>>>> 
>>> ...
>>> 
>>> 
>>>> So, I have pretty much no idea how to debug this... Any suggestions are
>>>> appreciated.
>>>> 
>>>> Hunter
>>>> 
>>> 
>>> 
>> 
> 
> 
> -- 
> 
>                 wWw
>                (o o)
> -------------ooO-(_)-Ooo-----------------------------------------------
> Laurent Bihanic           | Tel: +33 (0)1 55.91.21.93  (Direct line)
> Atos Origin               |      +33 (0)1 55.91.20.00
> Intégration - e-Business  | Fax: +33 (0)1 55.91.22.31
> Les Miroirs - Bat. C      |
> 18, avenue d'Alsace       |
> F-92926 La Defense Cedex  | e-Mail: laurent.bihanic at atosorigin.com
> -----------------------------------------------------------------------
> 
> "Microsoft isn't the answer. Microsoft is the question and the answer
> is no."
> 
> 
> DISCLAIMER:
> The opinions expressed are entirely my own and may not necessarily be
> those of my employer.  Also, I am not now nor have I ever been a
> lawyer.  My opinions are provided as-is with absolutely no warrantee of
> merchantability or fitness for any particular use.  Besides, you can't
> prove I typed this.  No body saw me type this.  Who says I typed this?
> 
> 
> 




More information about the jdom-interest mailing list