org.xml.sax.SAXParseException: Invalid byte 2 of 3-byte UTF-8 sequence

24.4k Views Asked by At

I am encountering the above error in production environment whereas the process went fine in UAT.

I was wondering whether this error is related to jar file loading. We are using webmethods and the above error occurred for a java service.

2

There are 2 best solutions below

6
On

The xml file you load is not correctly encoded: take a look at the production environment files, at least one is not UTF-8.

1
On

The most likely scenario is that the file is ISO-8859-1 encoded and contains extended ASCII (characters between 0x80 and 0xff inclusive). The parser is expecting UTF-8 and one of the extended characters is being interpreted as the start of a 3-byte sequence, but is not followed by a byte that is valid in that position.