Type interface mybatispro.Model.dao.AdminDao is not known to the MapperRegistry.
时间: 2024-04-29 12:19:13 浏览: 115
这个错误是因为MapperRegistry无法识别mybatispro.Model.dao.AdminDao接口的类型。可能的原因有以下几种:
1. 在AdminDao接口上缺少@Mapper注解。请确保在AdminDao接口上添加@Mapper注解,以告诉MyBatis将其作为Mapper进行扫描和注册。
2. 在项目的主文件application.java中没有添加@MapperScan(basePackages = "XXX.XXX.XXX.dao")注解。请在应用的主配置文件中添加@MapperScan注解,并确保basePackages参数指向正确的dao包路径。
3. 在AdminDao的配置文件中存在错误。请检查AdminDao的配置文件是否正确,特别是检查SQL语句是否正确编写。
请根据以上几种可能的原因逐一排查,以解决Type interface mybatispro.Model.dao.AdminDao is not known to the MapperRegistry的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [SpringBoot踩坑--No qualifying bean of type ‘XXX.XXX.XXX.dao.XXXDao‘ available](https://blog.csdn.net/weixin_43846347/article/details/116530495)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Mapper method ‘xxx.dao.xxx‘ attempted to return null from amethod with a primitive return type ...](https://blog.csdn.net/Erudite_x/article/details/120949946)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文