Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing Exception with JAXB 1.0.6 : XML files containing UTF-8 characters

 
sumitha sudhakar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My application is using JAXB 1.0.6 and JDK 1.4, When am trying to parse some XML files which contatining some UTF-8 characters, parsing has failed.
Here is the code which am using

this throws the following exception:
**************************************
javax.xml.bind.UnmarshalException: Content is not allowed in prolog.
- with linked exception:
[org.xml.sax.SAXParseException: Content is not allowed in prolog.]
Please help me out. how can i unmarshall an XML file having UTF 8 char encoded.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you so sure the problem is UTF-8?

Content is not allowed in prolog.


can simply mean the first character in the stream is not a < - the parser expects the first line to start <?xml

If this was my problem I would take a close look at the initial characters.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic