- 问题描述:
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 2 字节的 UTF-8 序列的字节 2 无效。 - 解决方法:pom中添加如下配置,并且清理maven target文件(不清理仍然保有原有配置):
<build> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build>
MyBatis:com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 2 字节的 UTF-8 序列
本文解决了一个 Maven 项目中出现的 UTF-8 字节序列错误问题,通过在 pom.xml 中添加资源文件的 UTF-8 编码配置,并清理了 Maven 的 target 文件夹。

被折叠的 条评论
为什么被折叠?



