Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This is a rather special kind of an IO exception that indicates a mismatch between the bytes of a file and its encoding. For instance, if a POM file declares

Code Block
xml
xml

<?xml version="1.0" encoding="UTF-8"?>

in its header, its binary contents must be a valid UTF-8 byte sequence. This means that any Nonnon-ASCII character needs to be encoded as a sequence of two or more bytes. A file whose contents is are not properly encoded, e.g. because a user edited/saved the file in another encoding than specified in the XML declaration, can cause this exception. While this exception is not raised on all JREs, the underlying issue is the same, the file contents The file content is invalid and needs to be re-encoded to fit the declared encoding or the encoding given by the XML declaration needs to be adjusted to match the contentscontent.