1.编写简单的mybatis架构后,运行显示出现错误:Type interface com.dao.UserDao is not known to the MapperRegistry.

2.添加mybatis-config.xml中<mappers>代码

    <mappers><mapper resource="com/dao/UserMapper.xml"/></mappers>

出现错误:Could not find resource com/dao/UserMapper.xml

3.在pom.xml中</project>前添加一下代码,之后刷新maven 运行成功

<!--    设置资源目录,使其可以读取dao下xml文件--><build><resources><resource><directory>src/main/resources</directory><includes><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>true</filtering></resource><resource><directory>src/main/java</directory><includes><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>true</filtering></resource></resources></build>

Mybatis错误:Type interface com.dao.UserDao is not known to the MapperRegistry.相关推荐

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

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

  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. Type interface com.haroro.dao.UserDao is not known to the MapperRegistry——MyBatis问题

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

  4. Error instantiating interface com.dao.UserDao with invalid types () or values (). Cause: java.lang.N

    报错结果 ### Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating interface com. ...

  5. mybatis报错Type interface xxx.Dao is not...

    今天在做mybatis的时候,遇到一个错误,大家看看这个错误吧:org.apache.ibatis.binding.BindingException: Type interface cn.mybati ...

  6. mybatis报错Type interface xxx.Dao is not known to the MapperRegistry

    今天在做mybatis的时候,遇到一个错误,大家看看这个错误吧:org.apache.ibatis.binding.BindingException: Type interface cn.mybati ...

  7. Consider defining a bean of type ‘com.zsb.dao.UserDao‘ in your configuration.

    在网上找了很多中的方法去修改它 比如有很多都是说的报错原因是因为在Mapper或者Dao层缺少注解 或者是service层等等,我就不再赘述了,很明显我的不是因为这种情况 这个问题就是@SpringB ...

  8. Description: A component required a bean of type ‘com.jia.dao.UserDao‘ that

    解决办法:在启动类上添加@MapperScan("com.jia.dao") @MapperScan("com.jia.dao") @SpringBootApp ...

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

最新文章

  1. 求5个学生4门成绩的总分和平均分
  2. [*开同*看] 星际情书
  3. 腾讯老照片修复算法开源,细节到头发丝,3种预训练模型可下载 | GitHub热榜
  4. 学习《Hardware-Efficient Bilateral Filtering for Stereo Matching》一文笔记。
  5. 如何恢复master数据库
  6. [导入]php 安全基础 第八章 共享主机 文件系统浏览
  7. 安装win7系统不能开机启动服务器,win7系统开机启动项不能加载的原因分析及解决...
  8. 程序员需要了解的一点组织行为学知识
  9. 【效率专精系列】善用API统一描述语言提升RestAPI开发效率
  10. Modbus协议栈应用实例之二:Modbus RTU从站应用
  11. Per-class allocator 2
  12. 【python3.X】python学习中排雷过程^_^
  13. NSCache实现内存缓存
  14. virbox protector 为软件设置有效期_条码软件如何打印UCC-128条形码
  15. python-坦克射击飞机
  16. 富爸爸实现财务自由七步骤
  17. 利用 confluence 打造属于自己的知识库
  18. 使用WampServer搭建自己的网站
  19. 记一次github 翻车事件
  20. 【嵌入式】51单片机+1602+dht11显示温湿度

热门文章

  1. php 开启常驻进程,swoole如何常驻进程
  2. Maya 搭建PyCharm 插件开发环境
  3. 旋转机械(轴承等)故障诊断公开数据集
  4. 关于meta NAME=keywords CONTENT=
  5. error LNK2005: _DllMain@12 already defined in xxx 的应对
  6. react状态管理ppt
  7. 盛世昊通PCC通证支付板块, 通证经济引爆新一轮数字经济革命
  8. 基于Spring等框架的会议管理系统
  9. 实现 LRU 缓存算法
  10. Centos磁盘空间清理