问题
Error building SqlSession.
The error may exist in com/ycm/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: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 14; 1 字节的 UTF-8 序列的字节 1 无效。
注意这个问题:重点是字节的UTF-8序列的字节1无效
一般发生这个错误,是因为编码格式的问题,由于使用的IDE默认的编码格式不是UTF-8的,所以识别不了UTF-8中的“-”
解决方法
- 更改IDE的默认的编码格式,都改成UTF-8(推荐)
- 去掉UTF-8字符串中的“-”