Mapped Statements collection already contains value for ……
程序员文章站
2022-07-15 12:06:16
...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/zz/sm/bean/SpringMybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [com/zz/sm/bean/BookUserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.zz.sm.dao.IBookUserDao.register
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
(以下省略)
出现映射语句重复给值的原因在于: <property name="mapperLocations" value="classpath:com/BookUserMapper.xml" />
<property name="configLocation" value="classpath:mybatis-config.xml"/>
我在mybatis-config.xml配置了相关的xml映射文件并且又引入第一个标签,去掉其一后即可正常测试
上一篇: 算法题/数组中出现1次的两个数
下一篇: 异或的性质及应用
推荐阅读
-
使用mybatis报错【Result Maps collection already contains value for ...BaseResultMap】的解决方法
-
moven 部署Sping与mybatis时,Mapped Statements collection does not contain value for Xxxxxxxx
-
【Bug解决】org.apache.ibatis.type.TypeException: The alias ‘xxxx‘ is already mapped to the value ‘xxx‘
-
java.lang.IllegalArgumentException: Result Maps collection already contains value for
-
Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for ...
-
mybatis****Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains va
-
java.lang.IllegalArgumentException: Result Maps collection already contains value for
-
Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for.....
-
解决:Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for xxx
-
Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for……