We parse an XML document using JAXB and get this error:
[org.xml.sax.SAXParseException: Invalid byte 1 of 1-byte UTF-8 sequence.]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315)
What exactly does this mean and how can we solve it?
We execute the code as:
jaxbContext = JAXBContext.newInstance(Results.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setSchema(getSchema());
results = (Results) unmarshaller.unmarshal(new FileInputStream(inputFile));
Update
The problem is due to this funny character in the XML file: ¿
Why can this cause such a problem?
Update 2
There are two of these strange characters in the file. They are around the middle of the file. Please note that the file is created based on the data in the database, and these strange characters somehow got into the database.
Update 3
Here is the complete XML snippet:
<Description><![CDATA[Mt. Belvieu ¿ Texas]]></Description>
Update 4
Please note that there is no title <?xml ...?>.
HEX for special character - BF