Error building SqlSession. ### The error may exist in dao/UserMapper.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration(2 字节的 UTF-8 序列的字节 2 无效。)
关于在学习Mybatis框架时运行报错
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in 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: 2 字节的 UTF-8 序列的字节 2 无效。
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)
at utils.MybatisUtils.<clinit>(MybatisUtils.java:21)
... 1 more
个人在网上搜索了许多相关的资料都无济于事,于是检查报错内容Error parsing SQL Mapper Configuration代表xml的配置出现了问题,而且后面又有错误2 字节的 UTF-8 序列的字节 2 无效。,猜测是xml中的文字编码除了问题
解决问题
将xml文件中的汉字全部删除即可;
经测试发现,将UserMapper.xml下的文字删除即可;
参考
SAX错误– MalformedByteSequenceException:1字节UTF-8序列的无效字节1。
Error building SqlSession. ### The error may exist in dao/UserMapper.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration(2 字节的 UTF-8 序列的字节 2 无效。)的更多相关文章
- The error may exist in com/bjpowernode/dao/StudentDao.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderExcept
The error may exist in com/bjpowernode/dao/StudentDao.xml### Cause: org.apache.ibatis.builder.Builde ...
- ### Error building SqlSession. ### The error may exist in SQL Mapper Configuration ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibat
这是一个由粗心导致的错误,具体报错如下: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSessio ...
- ### 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.
在做多表映射查询时,在同一个resultMap中写了1:1映射和1:n映射,结果测试时报错如下: org.apache.ibatis.exceptions.PersistenceException: ...
- Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xm
mybatis解析xml配置文件出现异常: org.apache.ibatis.exceptions.PersistenceException: Error building SqlSession. ...
- 报错 ———— Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 6; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。
报错 <?xml version="1.0" encoding="UTF-8"?> 必须是XML文件的第一个元素且前面不能空格. ### Erro ...
- org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML.问题思路
15:36:34,549 WARN DefaultListableBeanFactory:1416 - Bean creation exception on FactoryBean type chec ...
- 解决:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'requestMap.maintenancename != null and requestMap.maintenance
异常如下:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.Builde ...
- mybatis <fireach> 拼接sql语句 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'in'. Cause:
<select id="getUserIn" parameterType="QueryVo" resultMap="userMap"& ...
- mybatis异常:nested exception is org.apache.ibatis.builder.BuilderException: Error resolving JdbcType
异常详细 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.Builde ...
随机推荐
- istio的sidecar原理学习
目的 从内嵌到应用的SDK模式转成istio servicemesh,再到最新提出来的proxyless可谓是发展太快了.刚开始我只是围绕着服务注册和发现是怎么转变来展开研究,但是发现这个话题有点大, ...
- C++之去重
note 今天刷题,忘了去重复库函数,于是手写了一个. 前提: 必须保证数组是有序的. 源码 template <typename T> void unique_arr(T arr[], ...
- libevent之学习文档
1.官方文档 2.中文版 3.gitbook
- 【LeetCode】621. Task Scheduler 解题报告(Python & C++)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 公式法 日期 题目地址:https://leetco ...
- Oracle VirtualBox 配置宿主机与虚拟机互访
写作原因 之前经常使用 VMware Workstation Pro,由于是非正常付费使用的不打算再用了.替代品就是 Oracle VirtualBox,但是发现了一个问题: "我想用NAT ...
- [Elasticsearch] ES聚合场景下部分结果数据未返回问题分析
背景 在对ES某个筛选字段聚合查询,类似groupBy操作后,发现该字段新增的数据,聚合结果没有展示出来,但是用户在全文检索新增的筛选数据后,又可以查询出来, 针对该问题进行了相关排查. 排查思路 首 ...
- 第三十七个知识点: The Number Field Sieve
第三十七个知识点: The Number Field Sieve 数域筛法(The Number Field Sieve ,NFS)是已知的分解算法中最有效率的.它的运行时间取决于被分解的数的大小而不 ...
- [炼丹术]EfficientDet训练模型学习总结
EfficientDet训练模型学习总结 1.Introduction简介 pytorch用SOTA实时重新实现官方EfficientDet,原文链接:https : //arxiv.org/abs/ ...
- CS5268替代AG9321MCQ 替代AG9321方案 TYPEC转HDMI多功能拓展坞
台湾安格AG9321MCQ是一款TYPEC拓展坞产品方案,他集中了TYPEC 转HDMI VGA PD3.0快充 QC3.0数据传输 I2S接口的音频DAC输出以及可以各种读卡器功能. Caps ...
- getRequestDispatcher 中请求转发和请求包含的使用说明
getRequestDispatcher() getRequestDispatcher() 包含两个方法,分别是请求转发和请求包含. RequestDispatcher rd = request.ge ...