mybatis问题【Type interface com.qfedu.dao.StudentDAO is not known to the MapperRegistry】
项目场景:
在学习SSM的路上老是遇见奇奇怪怪的报错,弄这些错误花费了巨大的精力,于是打算记录一下希望对正在学习的大家有帮助
第一个Mybatis项目
问题描述
错误提示如下:
org.apache.ibatis.binding.BindingException: Type interface com.qfedu.dao.StudentDAO is not known to the MapperRegistry.
---
# 原因分析:
//mapper包下的StudentMapper.xml文件
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com/qfedu/dao/StudentDAO.java"><insert id="insertStudent">insert into tb_students(stu_num,stu_name,stu_gender,stu_age)value(#{stuNum},#{stuName},#{stuGender},#{stuAge})</insert><delete id="deleteStudent">delete from tb_students where stu_num=#{stuNum}</delete>
</mapper>最后发现是mapper包下的<mapper namespace路径格式不对,
<mapper namespace="com/qfedu/dao/StudentDAO.java">是错误的(这是来自根源的路径)
<mapper namespace="com.qfedu.dao.StudentDAO">才是正确的(这是复制引用)
# 正确格式:
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qfedu.dao.StudentDAO"><insert id="insertStudent">insert into tb_students(stu_num,stu_name,stu_gender,stu_age)value(#{stuNum},#{stuName},#{stuGender},#{stuAge})</insert><delete id="deleteStudent">delete from tb_students where stu_num=#{stuNum}</delete>
</mapper>
mybatis问题【Type interface com.qfedu.dao.StudentDAO is not known to the MapperRegistry】相关推荐
- Type interface com.haroro.dao.UserDao is not known to the MapperRegistry——MyBatis问题
初学MyBatis的时候,往往出现的错误都是一些细节上引起的.今天就遇到了一个问题,在运行测试类的时候,出现了以下的错误提示: org.apache.ibatis.binding.BindingExc ...
- mybatis错误:Type interface com.sks.dao.UserDao is not known to the MapperRegistry.
mybatis错误org.apache.ibatis.binding.BindingException: Type interface com.sks.dao.UserDao is not known ...
- Mybatis报误错: Type interface com.xu.dao.IAccountDao is not known to the MapperRegistry.
org.apache.ibatis.binding.BindingException: Type interface com.xu.dao.IAccountDao is not known to th ...
- MyBatis:Type interface com.xxx.dao.xxxMapper is not known to the MapperRegistry报错解决方案
目录 问题原因 解决方案 问题原因 如图显示所报的异常: 由于我们刚改成接口时忘记在xxxMapper.xml文件中对namespace修改接口的名称所导致的错误发生.这是我没改之前的截图: 解决方案 ...
- Type interface com.msy.dao.IAccountDao is not known to the MapperRegistry.
创建新的test的时候出现的错误 这个时候提示找不到MapperRegistry 所以是主配置文件里面的mapper忘记改了
- Mybatis报错org.apache.ibatis.binding.BindingException: Type interface com.trf.dao.UserDao is not known
报错log:org.apache.ibatis.binding.BindingException: Type interface com.trf.dao.UserDao is not known to ...
- org.apache.ibatis.binding.BindingException: Type interface com.kuang.dao.UserDao is not known to the
错误:绑定异常 org.apache.ibatis.binding.BindingException: Type interface com.kuang.dao.UserDao is not know ...
- org.apache.ibatis.binding.BindingException:Type interface com.itcase.dao.UserDao is not knownto the
报错信息: org.apache.ibatis.binding.BindingException: Type interface com.itcase.dao.UserDao is not known ...
- Type interface com.dao.StudentDao is not known to the MapperRegistry.
在使用SqlSession的getMapper(StudentDao.class)方法中遇到的问题:Type interface com.dao.StudentDao is not known to ...
最新文章
- 中国电子学会图形化四级编程题:绳子算法
- 中了Globelmposter3.0,后缀为4444怎么解决勒索病毒解密
- 告别学术论文恐慌!休斯顿大学教授的这个建议,让学术写作更简单
- DeepFake疑遭审查
- Redfield.Sketch.Master中文版
- map文件分析 stm32_浅谈STM32的启动过程
- 为什么 Oracle 应该主推 NetBeans
- sys.dm_db_wait_stats
- 安卓接入高德地图3dmap黑屏问题解决
- 好用的mysql数据字典工具
- staruml顺序图转通信图_ICAO航图详解——机场图
- iOS 9键盘类型合集
- QCC高通烧录驱动安装方法
- linux 消息队列实现通信
- http的ssl证书保姆级配置安装-多域名 免费ssl证书 解析 nginx配置
- 基于内容可变长度分块Content Defined Chunking
- 源码包安装Nginx(1.19.1),并配置Nginx,比如:用户认证,防盗链,虚拟主机,SSL等功能
- 【分享】如何判断个人电脑是多少位(32位?还是64位系统)
- 李宏毅《Deep Learning》学习笔记 - transformer
- Python - 寻找数组的子集
热门文章
- 中间视频上下图片的视频效果怎么制作
- 下一代智能扫码报修系统介绍
- pandas实现列转行
- 基于MATLAB APP Designer 和 Python 的音视频剪辑App_02
- 迁移TFS,批量将文档导入SharePoint 2013 文档库
- 1 1 2 3 5 8 13 21 代码实现 java(斐波那契数列)
- [博弈论] Nim游戏及SG函数(经典+台阶+集合+拆分)
- 蓝奏云PHP解析接口,蓝奏云下载地址解析API[直链]
- 我永远喜欢我的偶像 KIKU
- 西门子mr图像后处理手册_西门子MRI操作手册手工版