报错 Type interface *** is not known to the MapperRegistry. 的解决方案

今天我在学习mybatis时碰到了这个报错:org.apache.ibatis.binding.BindingException: Type interface *** is not known to the MapperRegistry.

通过搜索引擎找了很久之后都没能找到解决方案,网上流传的比较多的解决方案是:mapper.xml文件放置到跟接口DAO.java不同名,或者是mapper.xml的namespace没有写对。但是我的错误都不是上述问题。

后来我想了想,我在写完mapper.xml后,还没在config.xml将该mapper.xml配置进来。

 在config.xml中配置好mapper.xml后,项目报错的问题就解决了。

技术分享图片

 

文章来自:https://www.cnblogs.com/ZekeBlog/p/9360689.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3