项目场景:

在学习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】相关推荐

  1. Type interface com.haroro.dao.UserDao is not known to the MapperRegistry——MyBatis问题

    初学MyBatis的时候,往往出现的错误都是一些细节上引起的.今天就遇到了一个问题,在运行测试类的时候,出现了以下的错误提示: org.apache.ibatis.binding.BindingExc ...

  2. 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 ...

  3. 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 ...

  4. MyBatis:Type interface com.xxx.dao.xxxMapper is not known to the MapperRegistry报错解决方案

    目录 问题原因 解决方案 问题原因 如图显示所报的异常: 由于我们刚改成接口时忘记在xxxMapper.xml文件中对namespace修改接口的名称所导致的错误发生.这是我没改之前的截图: 解决方案 ...

  5. Type interface com.msy.dao.IAccountDao is not known to the MapperRegistry.

    创建新的test的时候出现的错误 这个时候提示找不到MapperRegistry 所以是主配置文件里面的mapper忘记改了

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. Type interface com.dao.StudentDao is not known to the MapperRegistry.

    在使用SqlSession的getMapper(StudentDao.class)方法中遇到的问题:Type interface com.dao.StudentDao is not known to ...

最新文章

  1. 中国电子学会图形化四级编程题:绳子算法
  2. 中了Globelmposter3.0,后缀为4444怎么解决勒索病毒解密
  3. 告别学术论文恐慌!休斯顿大学教授的这个建议,让学术写作更简单
  4. DeepFake疑遭审查
  5. Redfield.Sketch.Master中文版
  6. map文件分析 stm32_浅谈STM32的启动过程
  7. 为什么 Oracle 应该主推 NetBeans
  8. sys.dm_db_wait_stats
  9. 安卓接入高德地图3dmap黑屏问题解决
  10. 好用的mysql数据字典工具
  11. staruml顺序图转通信图_ICAO航图详解——机场图
  12. iOS 9键盘类型合集
  13. QCC高通烧录驱动安装方法
  14. linux 消息队列实现通信
  15. http的ssl证书保姆级配置安装-多域名 免费ssl证书 解析 nginx配置
  16. 基于内容可变长度分块Content Defined Chunking
  17. 源码包安装Nginx(1.19.1),并配置Nginx,比如:用户认证,防盗链,虚拟主机,SSL等功能
  18. 【分享】如何判断个人电脑是多少位(32位?还是64位系统)
  19. 李宏毅《Deep Learning》学习笔记 - transformer
  20. Python - 寻找数组的子集

热门文章

  1. 中间视频上下图片的视频效果怎么制作
  2. 下一代智能扫码报修系统介绍
  3. pandas实现列转行
  4. 基于MATLAB APP Designer 和 Python 的音视频剪辑App_02
  5. 迁移TFS,批量将文档导入SharePoint 2013 文档库
  6. 1 1 2 3 5 8 13 21 代码实现 java(斐波那契数列)
  7. [博弈论] Nim游戏及SG函数(经典+台阶+集合+拆分)
  8. 蓝奏云PHP解析接口,蓝奏云下载地址解析API[直链]
  9. 我永远喜欢我的偶像 KIKU
  10. 西门子mr图像后处理手册_西门子MRI操作手册手工版