首页
碎碎念
东邻西舍
本站信息
前来吐槽
统计
Search
1
openwrt系统上安装第三方插件
26,758 阅读
2
ubuntu下zerotier的基本使用教程
13,578 阅读
3
给小米R3G更换系统:从padavan刷成openwrt
12,848 阅读
4
openwrt使用第一步:设置上网拨号
10,741 阅读
5
openwrt无线中继功能:实现不插网线就能上网
9,519 阅读
学习点滴
Java
Web前端
Linux
踩坑实录
折腾搞机
关于建站
只言片语
登录
Search
标签搜索
Linux
建站
Java
踩坑实录
Ubuntu
MySQL
折腾搞机
HTML
CSS
MyBatis
Spring
SQL
Nginx
路由器
树莓派
OpenWrt
Maven
Git
Win10
只言片语
知识分子没文化
累计撰写
83
篇文章
累计收到
152
条评论
首页
栏目
学习点滴
Java
Web前端
Linux
踩坑实录
折腾搞机
关于建站
只言片语
页面
碎碎念
东邻西舍
本站信息
前来吐槽
统计
搜索到
7
篇与
的结果
2021-05-25
【踩坑实录】mybatis项目报错:“Caused by: .....Exception: 1 字节的 UTF-8 序列的字节 1 无效”
环境说明: 系统:win10 专业版 开发环境:IDEA JDK版本:1.8 mysql:5.5 mybatis:3.5.3 Junit:5.7.0 问题再现: 运行mybatis项目时,控制台出现报错信息: Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效 错误原因: 归根结底是编码的原因,xml文件开头的文档编码设置为了UTF-8: 而由于项目本身的默认编码是GBK,因此xml文件保存时的编码是GBK,声明的xml文档编码与实际编码不一致,就出现了问题 解决方法: 更改项目编码即可。 在IDEA界面打开setting(点击File->setting或者快捷键Ctrl+Alt+S),依次选择Editor->File encodings,将Project Encoding的值从GBK更改为UTF-8。 再次运行,问题消失。
2021年05月25日
1,334 阅读
0 评论
0 点赞
2021-05-25
踩坑实录|mybatis项目报错:...Exception: Type interface UserMapper is not known to the MapperRegistry
环境说明: 系统:win10 专业版 开发环境:IDEA JDK版本:1.8 mysql:5.5 mybatis:3.5.3 Junit:5.7.0 问题再现: mybatis项目运行时报错,报错信息如下: org.apache.ibatis.binding.BindingException: Type interface com.langp.dao.UserMapper is not known to the MapperRegistry. at org.apache.ibatis.binding.MapperRegistry.getMapper(MapperRegistry.java:47) at org.apache.ibatis.session.Configuration.getMapper(Configuration.java:779) at com.langp.dao.UserMapperTest.getUserList(UserMapperTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.lang.reflect.Method.invoke(Method.java:498) ····· Process finished with exit code -1 错误原因: 报错信息中出现了Type interface com.langp.dao.UserMapper is not known to the MapperRegistry,简单翻译一下就是:类型接口com.langp.dao.UserMapper不为MapperRegistry所知。 所以这个错误肯定是与mapper有关系的。每一个Mapper.xml都需要在mybatis核心配置文件中进行注册,由于mybatis的核心配置文件mybatis-config.xml中缺少对应接口的Mapper.xml,所以运行时就会报错。 解决方法: 在mybatis的核心配置文件中添加如下内容: <!-- 每一个mapper.xml配置文件都需要在mybaits核心文件中注册 --> <mappers> <mapper resource="com/langp/dao/UserMapper.xml"></mapper> </mappers> 其中,resource属性的值是接口对应Mapper.xml文件。添加之后即可解决。
2021年05月25日
2,514 阅读
0 评论
1 点赞
1
2