Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8

SA-10308

Summary



UTFDataFormatException exceptions in the logs are observed. What is the root cause of these exceptions?

Error Messages



[4/15/15 15:04:57:375 xxx] 000000bc SystemErr R FATAL ERROR: 'java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.'
:Invalid byte 1 of 1-byte UTF-8 sequence.
[4/15/15 15:06:18:137 xxx] 00000056 SystemErr R FATAL ERROR: 'java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.'
:Invalid byte 1 of 1-byte UTF-8 sequence.
[4/15/15 15:10:24:246 xxx] 000000bc SystemErr R FATAL ERROR: 'java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.'
:Invalid byte 1 of 1-byte UTF-8 sequence.
[4/15/15 15:10:35:837 xxx] 00000056 SystemErr R FATAL ERROR: 'java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.'
:Invalid byte 1 of 1-byte UTF-8 sequence.


Steps to Reproduce



Not Applicable

Root Cause



The exception 'java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.' does not belong to Pega code. This exception is thrown at Java level class, due to an issue while reading or parsing UFT-8 encoded XML string.
Java takes the byte array from the XML string, and gives that array as input to XML reader stream. To do this java uses java.lang.String.getBytes() method which returns a byte array.

Resolution



The above exception occurs in any of the below two cases: 
  • java.lang.String.getBytes() method uses the JVM platform's default charset / encoding to store the result into a byte array. If the platform's default encoding is other than 'UFT-8', this exception is thrown while reading or parsing XML strings.
  • Incase there are any Chinese characters in the XML files which is getting read or parsed, it results in this exception.

Published June 12, 2015 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us