com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [scheduling.xml]; nested exception is com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。

解决:解析xml时,有中文,此时把xml文件的头

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

改成:

<?xml version="1.0" encoding="GBK"?>

即可!

原文地址:https://www.cnblogs.com/gmq-sh/p/4324449.html