错误详情:
Error building SqlSession.
The error may exist in com/lengzher/Dao/UserMapper.xml
Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效。
问题解决:
- 错误写到:The error may exist in com/lengzher/Dao/UserMapper.xml,说明问题出在UserMapper.xml中可能写错了,比如路径写错了,多了空格等等。但是我们的错误却不仅仅于此;
- 后面错误日志写到:1 字节的 UTF-8 序列的字节 1 无效。说明是UserMapper.xml中出现了中文!!!注意:UserMapper.xml中不要出现中文,哪怕是注释!!!
- 将UserMapper.xml中的中文删除,问题解决
- 还可以将头文件<?xml version="1.0" encoding="UTF-8" ?>改为<?xml version="1.0" encoding="UTF8" ?>,问题解决!!!