#Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.xkl.Dao1.UserMapper.getList2. please check com/xkl/Dao1/UserMapper.xml and class path resource [com/xkl/Dao1/UserMapper.xml]
在Spring和Mybatis的整合学习过程中,发现了这个bug找了好久(头秃)
后来才发现是在原先的Mybatis-config的配置中忘记删除:

因为在Spring-mybatis中有对Mapper的路径进行注入:

将Mybatis-config中的mapper路径注释后就可以了。
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value f
最新推荐文章于 2022-11-22 17:17:17 发布
在学习Spring与Mybatis整合时遇到一个bug,导致出现'MappedStatements collection already contains value...'的错误。问题根源在于Mybatis-config配置文件中未删除的重复Mapper路径。解决方法是检查并注释掉Spring配置中多余的Mapper路径注入,确保配置的一致性。
2544

被折叠的 条评论
为什么被折叠?



