报错信息:

Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com.web.mybatis.i.PersonMapper 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:750)
at org.apache.ibatis.session.defaults.DefaultSqlSession.getMapper(DefaultSqlSession.java:292)
at com.web.mybatis.test.Test.oneToOneTest(Test.java:14)
at com.web.mybatis.test.Test.main(Test.java:24)

原因:使用MyBatis框架访问数据库时,与Mapper文件对应的接口和mapper文件的文件路径不相同

将mapper文件和接口文件放到同一包下

MyBatis—— org.apache.ibatis.binding.BindingException: Type interface com.web.mybatis.i.PersonMapper is not known to the MapperRegistry.的更多相关文章

  1. 报错org.apache.ibatis.binding.BindingException: Type interface com.atguigu.mybatis.bean.dao.EmployeeMapper is not known to the MapperRegistry.

    报错org.apache.ibatis.binding.BindingException: Type interface com.atguigu.mybatis.bean.dao.EmployeeMa ...

  2. Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com.test.bean.groupMapper is not known to the MapperRegistry.

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

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

    动态代理因为namespace的地方写错了

  4. [MyBatis]org.apache.ibatis.binding.BindingException的避免

    我遇到的org.apache.ibatis.binding.BindingException问题是因为Mapper.java中接口和SQL的参数多于一个,Mybatis不知道如何一一对应,解决方法是加 ...

  5. mybatis运行出现org.apache.ibatis.binding.BindingException

    今天学习mybatis的第一天,发现用junit测试报出了次异常:org.apache.ibatis.binding.BindingException: Type interface cn.dzp.d ...

  6. SpringBoot整合Mybatis注解版---update出现org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found. Available parameters are [arg1, arg0, param1, param2]

    SpringBoot整合Mybatis注解版---update时出现的问题 问题描述: 1.sql建表语句 DROP TABLE IF EXISTS `department`; CREATE TABL ...

  7. MyBatis笔记----报错Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser

    信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@41cf53f9: startup ...

  8. mybatis错误之org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    玩了MyBatis差不多有两年了,中间也玩过MyBatis-Plus,这个MyBatis-Plus其实与MyBatis的区别并不大.今天写博客业务代码的时候,犯一个初学者犯过的错误. 错误信息如下:o ...

  9. Mybatis笔记二:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    错误异常:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.test.dao.N ...

随机推荐

  1. 7.JUC线程高级-生产消费问题&虚假唤醒

    描述 生产消费问题在java多线程的学习中是经常遇到的问题 ,多个线程共享通一个资源的时候会出现各种多线程中经常出现的各种问题. 实例说明 三个类:售货员Clerk,工厂Factory,消费者Cons ...

  2. MySQL分页查询的性能优化

    MySQL limit分页查询的性能优化 Mysql的分页查询十分简单,但是当数据量大的时候一般的分页就吃不消了. 传统分页查询:SELECT c1,c2,cn… FROM table LIMIT n ...

  3. Process Synchronization-Example 2

    问题描述 理发店有一位理发师,一把理发椅和N把供等候的顾客坐的椅子. 如果没有顾客,理发师在理发椅上睡觉: 当有一个顾客到来时,他必须先唤醒理发师: 如果顾客来时理发师正在理发,如果有空椅子,坐下等待 ...

  4. windows中配置安装mysql数据库

    MySql 是一种免费的关系型数据库,相较于 MsSqlServer 和 Oracle 比较轻量化,安装也很简单,而且免费不需要的版权费用,个人认为一般的小项目采用还是比较合适的,当然也有部分数据量很 ...

  5. redis-py中的坑

    今天发现,使用redis-py从redis中获取的数据竟然是加密的. conn = redis.Redis(host='redis_serverip', port=6379, password='re ...

  6. Ubuntu开机黑屏解决办法

    联想笔记本通过虚拟机安装Ubuntu12.04后,开机黑屏.这个问题和NVIDIA显卡有关.网上有人提到更改/etc/default/grub文件,可是我通过root身份也无法很好地修改该文件,遂放弃 ...

  7. js 跳出循环

    js 循环主要有 for while 主要有三种方式 :break continue return break是跳出当前整个循环语句,循环终止会继续执行该循环之后的代码 而continue是跳过当前循 ...

  8. 自己封装函数,实现数组的内置方法indexOf的功能

    在学习或开发过程中,经常会有朋友需要使用到一个数组方法-indexOf,这里我们先来谈谈它的功能:返回指定数据所在的索引,如果没有则返回-1. 那么我们在使用时通常是直接使用它这个数组内置方法 今天这 ...

  9. D - 小Z的加油店 线段树+差分+GCD

    D - 小Z的加油店 HYSBZ - 5028   这个题目是一个线段树+差分+GCD 推荐一个差分的博客:https://www.cnblogs.com/cjoierljl/p/8728110.ht ...

  10. Zuul源码分析

    先上一张流程图: 我们Zuul的使用如下: @SpringBootApplication @EnableZuulProxy public class ZuulApplication { public ...