commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Burkard <>
Subject [Digester] Error "Document root element is missing" for files with BOM
Date Fri, 11 Mar 2005 09:27:17 GMT
hi there

today i encountered a problem with an xml-to-object transformation with 
i get an exception saying "Document root element is missing" (stack 
trace below), but the xml seemed to be absolutely fine. because i found 
some posts in other groups that they had this with several editors, i 
opened the xml-files in textwrangler (macintosh text editor).

in textwrangler the encoding of the files was (absolutely correct) 
UTF-8. BUT as i opened other xml-files that were imported fine, i saw 
that these are declared as "UTF-8, no BOM".

as soon as i changed the problematic files to "no BOM", they were 
imported fine by digester.

a look in the docu of textwrangler says that this is for "byte order 
mark" and that it is recommended to save files always with this BOM. but 
as far as it looks, they can't parsed with digester.

is this a known bug? can i configure digester to work with these files too?

thanks and greetings

full stacktrace:
545  [main] ERROR org.apache.commons.digester.Digester  - Parse Fatal 
Error at line 1 column -1: Document root element is missing.
org.xml.sax.SAXParseException: Document root element is missing.
         at org.apache.crimson.parser.Parser2.fatal(
         at org.apache.crimson.parser.Parser2.fatal(
         at org.apache.crimson.parser.Parser2.parse(
         at org.apache.commons.digester.Digester.parse(

...and so on...

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message