org.apache.ibatis.binding.bindingexception: type interface com.atguigu.mybatis.mapper.usermapper is not known to the mapperregistry.
时间: 2023-04-18 08:03:28 浏览: 296
org.apache.ibatis.binding.BindingException: 类型接口com.atguigu.mybatis.mapper.UserMapper未知于MapperRegistry。
相关问题
org.apache.ibatis.binding.BindingException: Type interface com.atguigu.mybatis.mapper.UserMapper is not known to the MapperRegistry.
回答: 这个错误是由于MyBatis无法找到指定的Mapper接口导致的。根据引用\[1\]、\[2\]和\[3\]的信息,可以看出这个错误是由于Mapper接口的报名写错或者没有正确配置在核心配置文件中所致。请检查你的Mapper接口的报名是否正确,并确保在核心配置文件中正确配置了Mapper接口的路径。
#### 引用[.reference_title]
- *1* [org.apache.ibatis.binding.BindingException](https://blog.csdn.net/Kakarotto_lu/article/details/116585018)[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^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [解决 - 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^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [解决错误:org.apache.ibatis.binding.BindingException](https://blog.csdn.net/young_man2/article/details/125716766)[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^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
org.apache.ibatis.binding.BindingException: Type interface com_atguigu.mybatis.mapper.UserMapper 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 ]
阅读全文