当前位置:网站首页>【问题解决】ibatis.binding.BindingException: Type interface xxDao is not known to the MapperRegistry.
【问题解决】ibatis.binding.BindingException: Type interface xxDao is not known to the MapperRegistry.
2022-07-25 12:13:00 【宋丹敏】
问题描述:
org.apache.ibatis.binding.BindingException: Type interface com.kuang.dao.UserDao is not known to the MapperRegistry.
MapperRegistry不知道UserDao。
原因:
XXXDaoMapper.xml写了之后,没有在mybaits-config.xml配置文件中注册mapper,
没有注册mapper,写的 XXXDaoMapper.xml就不能实现XXXDao,因为他们之间没有进行绑定,
说白了,XXXDaoMapper.xml 就是 XXXDao.java中接口的实现类,
原来写实现类,是通过 xxxDaoImpl.java类 implement dao层的接口,从而实现绑定的,现在通过namespace来实现绑定
解决办法:
mybaits-config.xml中加入:
<mappers>
<mapper resource="com/kuang/dao/UserMapper.xml"></mapper>
</mappers>

日志:
org.apache.ibatis.binding.BindingException: Type interface com.kuang.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:732)
at org.apache.ibatis.session.defaults.DefaultSqlSession.getMapper(DefaultSqlSession.java:292)
at com.kuang.dao.UserDaoTest.test(UserDaoTest.java:42)
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:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
边栏推荐
- Pytorch project practice - fashionmnist fashion classification
- [micro service ~sentinel] sentinel degradation, current limiting, fusing
- 1.1.1 welcome to machine learning
- cmake 学习使用笔记(二)库的生成与使用
- 3.2.1 what is machine learning?
- Maskgae: masked graph modeling meets graph autoencoders
- Perf performance debugging
- 【九】坐标格网添加以及调整
- Azure Devops (XIV) use azure's private nuget warehouse
- 【5】 Page and print settings
猜你喜欢

More accurate and efficient segmentation of organs-at-risk in radiotherapy with Convolutional Neural

More accurate and efficient segmentation of organs-at-risk in radiotherapy with Convolutional Neural

MySQL练习二

2.1.2 application of machine learning

2022.07.24 (lc_6125_equal row and column pairs)
What does the software testing process include? What are the test methods?

PyTorch可视化

Interviewer: "classmate, have you ever done a real landing project?"

A method to prevent SYN flooding attacks -- syn cookies

【Flutter -- 实例】案例一:基础组件 & 布局组件综合实例
随机推荐
Intval MD5 bypass [wustctf2020] plain
Azure Devops(十四) 使用Azure的私有Nuget仓库
Fiddler抓包APP
启牛开的证券账户安全吗?是怎么开账户的
shell基础知识(退出控制、输入输出等)
1.1.1 welcome to machine learning
Alibaba cloud technology expert Qin long: reliability assurance is a must - how to carry out chaos engineering on the cloud?
弹性盒子(Flex Box)详解
Script set random user_ agent
【11】 Production and adjustment of vector and grid data Legends
【8】 Clever use of color finder
JS 中根据数组内元素的属性进行排序
2022.07.24(LC_6126_设计食物评分系统)
MySQL implements inserting data from one table into another table
Detailed explanation of flex box
推荐系统-协同过滤在Spark中的实现
Pytorch environment configuration and basic knowledge
Numpy first acquaintance
Microsoft azure and Analysys jointly released the report "Enterprise Cloud native platform driven digital transformation"
R language ggplot2 visualization: visualize the scatter diagram, add text labels to some data points in the scatter diagram, and use geom of ggrep package_ text_ The repl function avoids overlapping l