报错信息:

org.apache.ibatis.binding.BindingException: Type interface com.itcase.dao.UserDao 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 org.apache.ibatis.session.defaults.DefaultSqlSession.getMapper(DefaultSqlSession.java:291)at com.itcase.dao.UserDaoTest.test1(UserDaoTest.java:18)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)at org.junit.runners.ParentRunner.run(ParentRunner.java:309)at org.junit.runner.JUnitCore.run(JUnitCore.java:160)at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

一般这总情况就是

> Mybatis的config文件忘记在<configuration></configuration>
> 里加上以下代码了,下边的UserMapper.xml换成你们报错的文件
    <mappers><mapper resource="com/itcase/dao/UserMapper.xml"/></mappers>

要是加了mapper依然报错,如果是以下错误的话:点我看另一篇博客

Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in com/itcase/dao/UserMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/itcase/dao/UserMapper.xmlat 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 com.itcase.util.MybatisUtil.<clinit>(MybatisUtil.java:20)... 23 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/itcase/dao/UserMapper.xmlat org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:121)at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:98)at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:78)... 25 more
Caused by: java.io.IOException: Could not find resource com/itcase/dao/UserMapper.xmlat org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:114)at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:100)at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:372)at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:119)... 27 more

org.apache.ibatis.binding.BindingException:Type interface com.itcase.dao.UserDao is not knownto the相关推荐

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

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

  3. 解决Mybatis报错问题:org.apache.ibatis.binding.BindingException: Type interface com.kuang.dao.UserDao is

    解决方案分为两种情况: 1.在mybatis核心配置文件中(mybatis-config.xml)配置mappers <!--每一个Mapper.xml文件都需要在mybatis核心配置文件中注 ...

  4. MyBatis报错:org.apache.ibatis.binding.BindingException: Type interface com.smbms.dao.provider.Provider

    在Java使用MyBatis框架开发时,遇到报错:org.apache.ibatis.binding.BindingException: Type interface com.smbms.dao.pr ...

  5. org.apache.ibatis.binding.BindingException: Type interface xxx.Mapper is not known to the MapperRegi

    一.错误描述 今天心血来潮回顾了一下mybatis项目,发现如下错误: org.apache.ibatis.binding.BindingException: Type interface com.z ...

  6. 解决org.apache.ibatis.binding.BindingException: Type interface XXX is not known to the MapperRegistry

    笔者在做mybatis的一个例子的时候,出现了下面这一个报错 org.apache.ibatis.binding.BindingException: Type interface com.myBati ...

  7. 解决org.apache.ibatis.binding.BindingException: Type interface *** is not known to the MapperRegistry.

    解决org.apache.ibatis.binding.BindingException: Type interface com.mytest.dao.IUserDao is not known to ...

  8. 关于配置双数据源报错org.apache.ibatis.binding.BindingException: Type interface is not known to the MapperRegis

    报错org.apache.ibatis.binding.BindingException: Type interface is not known to the MapperRegistry.,在网上 ...

  9. Exception in thread “main“ org.apache.ibatis.binding.BindingException: Type interface com.neusoft.Id

    Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com. ...

最新文章

  1. Matlab中下标,斜体,及希腊字母的使用方法
  2. FreeRTOS(三)——资源管理
  3. visual studio 调试时提示 已加载“C:\Windows\SysWOW64\ntdll.dll”。无法查找或打开 PDB 文件。
  4. 将github pages搭建的网页添加到百度搜索资源平台上
  5. 使用opencv简单的播放AVI程序(40行)
  6. ASP.NET Core官方文档+源码,这样学效率高10倍!
  7. Android官方开发文档Training系列课程中文版:与其它APP交互之将用户带到其它的APP
  8. linux模拟发包工具,linux发包软件-线不是一个压力测试工具的linux以上收缩服务器可...
  9. smb协议讲解_SMB协议详解 - 人之为学,如饮河海,大饮则大盈,小饮则小盈 - OSCHINA - 中文开源技术交流社区...
  10. winedit注册码
  11. 视频类APP体验报告
  12. oracle rebuild online,Oracle index rebuild online 与 rebuild 及 drop index 后重建
  13. 使用OOP思想二次封装echarts
  14. .NET 针对465加密端口 加密协议SSL(Implicit SSL)进行的邮件发送
  15. 计算机网络基础知识满昌勇,-精选版《计算机网络》说课课件.ppt
  16. 假如生活欺骗了你--普希金
  17. 【转】Android权限获取机制与常见权限不足问题分析
  18. 80后的风口,80公里的感悟
  19. 【光线追踪】光线追踪重投影方法(Ray Tracing Reprojection)
  20. zabbix自定义报警——(邮箱,微信)

热门文章

  1. 浅谈前缀和(C++)
  2. 生成常用验证码识别,基于PaddleOCR训练识别
  3. c++ fill 二维数组初始化_C++如何给二维数组初始化
  4. 长期熬夜——真的不好
  5. zabbix中添加被监控主机(给被监控主机添加agent)
  6. python求最值_python怎么求一个函数的最值?
  7. Python基础 - Excel导入导出
  8. 推箱子更新版(模块化)
  9. android 苹果健康,模仿安卓?苹果或为iOS加入“数字健康”功能,帮用户戒掉手机瘾...
  10. java service包_利用 javaService 发布服务(jar包)