org.apache.ibatis.binding.BindingException: Type interface com_atguigu.mybatis.mapper.UserMapper is not known to the MapperRegistry.
时间: 2024-03-17 16:13:16 浏览: 135
Mybatis注解学习--xxxMapper is not known to the MapperRegistry
回答: 这个问题是由于核心配置文件中加载映射文件的包名写错导致的。具体来说,错误的包名是"com_atguigu.mybatis.mapper.UserMapper",而正确的包名应该是"com.atguigu.mybatis.mapper.UserMapper"。这个错误会导致MyBatis无法识别到UserMapper接口。解决这个问题的方法是将包名修改为正确的形式,即将"com_atguigu.mybatis.mapper"改为"com.atguigu.mybatis.mapper"。这样就能够正确加载映射文件并解决该异常。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* [解决 - org.apache.ibatis.binding.BindingException: Type interface com.itheima.mapper.UserMapper...](https://blog.csdn.net/weixin_51730356/article/details/129260822)[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^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [解决org.apache.ibatis.binding.BindingException: Type interface is not known to the MapperRegistry.](https://blog.csdn.net/WHT869706733/article/details/123271534)[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^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [org.apache.ibatis.binding.BindingException: Type interface xxx.Mapper is not known to the MapperRegi](https://blog.csdn.net/RadNICkMan/article/details/125381881)[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^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文