Mapped Statements collection already contains value for

解决了! 参考的网址:http://www.cnblogs.com/langtianya/archive/2013/03/18/2966491.html

错误原因是由于使用ibatis的F554281Mapper.xml实现接口F554281Mapper.java中的方法的时候的id有重复的值,比如

<select id="find81OrderBySovr01" resultMap="81ResultMap" parameterType="java.util.Map">中的find81OrderBySovr01在一个xml文件中有两个这样的id,修改过来即可

select查询中的parameterType 也可以是实体类 <select id="find81OrderBySovr01"  parameterType="com.chong.model.Account" resultType="int">

单词:nested  /nestid/   潜逃的

nested 英[nest?d] 美[nest?d]
adj. 嵌套的;
v. 筑巢( nest的过去式和过去分词 );

[例句]In the makeGrades method I use a code block nested inside of another code block.

在makeGrades方法中,我使用了嵌套在一个代码块中的另一个代码块。

[其他] 原型: nest

报错的报文:

nifiedOrderProject] 2017-01-10 17:17:00,334 [org.mybatis.spring.SqlSessionFactoryBean]-[DEBUG] Parsed mapper file: ‘file [D:\javaInstall\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\wtpwebapps\unifiedOrderProject\WEB-INF\classes\com\eaju\mapping\ReceiveMerchantOrder.xml]‘
[unifiedOrderProject] 2017-01-10 17:17:00,370 [org.mybatis.spring.SqlSessionFactoryBean]-[DEBUG] Parsed configuration file: ‘class path resource [mybatis-config.xml]‘
[unifiedOrderProject] 2017-01-10 17:17:00,401 [org.springframework.web.context.support.XmlWebApplicationContext]-[WARN] Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘unifiedOrderServiceImpl‘: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘f554281Mapper‘ defined in file [D:\javaInstall\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\wtpwebapps\unifiedOrderProject\WEB-INF\classes\com\eaju\dao81\F554281Mapper.class]: Cannot resolve reference to bean ‘sqlSessionFactory81‘ while setting bean property ‘sqlSessionFactory‘; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory81‘ defined in class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\javaInstall\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\wtpwebapps\unifiedOrderProject\WEB-INF\classes\com\eaju\mapping81\F554281Mapper.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.eaju.dao81.F554281Mapper.find81OrderBySovr01
 at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:308)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
 at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
 at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
 at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
 at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
 at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘f554281Mapper‘ defined in file [D:\javaInstall\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\wtpwebapps\unifiedOrderProject\WEB-INF\classes\com\eaju\dao81\F554281Mapper.class]: Cannot resolve reference to bean ‘sqlSessionFactory81‘ while setting bean property ‘sqlSessionFactory‘; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory81‘ defined in class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\javaInstall\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\wtpwebapps\unifiedOrderProject\WEB-INF\classes\com\eaju\mapping81\F554281Mapper.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.eaju.dao81.F554281Mapper.find81OrderBySovr01
 at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
 at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
 at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:461)
 at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:435)
 at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:559)
 at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169)
 at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
 at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:305)
 ... 22 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory81‘ defined in class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\javaInstall\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\wtpwebapps\unifiedOrderProject\WEB-INF\classes\com\eaju\mapping81\F554281Mapper.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.eaju.dao81.F554281Mapper.find81OrderBySovr01
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
 at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
 ... 37 more
Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\javaInstall\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\wtpwebapps\unifiedOrderProject\WEB-INF\classes\com\eaju\mapping81\F554281Mapper.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.eaju.dao81.F554281Mapper.find81OrderBySovr01
 at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:466)
 at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:340)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
 ... 44 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.eaju.dao81.F554281Mapper.find81OrderBySovr01
 at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:117)
 at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:89)
 at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:464)
 ... 47 more
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.eaju.dao81.F554281Mapper.find81OrderBySovr01
 at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:776)
 at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:748)
 at org.apache.ibatis.session.Configuration.addMappedStatement(Configuration.java:578)
 at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:315)

时间: 2024-10-08 15:53:23

Mapped Statements collection already contains value for的相关文章

Mapped Statements collection does not contain value for 问题的解决

在做SSM项目的时候,遇到MyBatis抛出的一个异常: Mapped Statements collection does not contain value for org.lyk.vo.mapping.NewsNS.findById. 2017-09-01 21:03:48,979 INFO [org.springframework.context.support.ClassPathXmlApplicationContext] - Refreshing org[email protecte

java.lang.IllegalArgumentException: XXX is ambiguous in Mapped Statements collection

问题的出现: 在后台添加一个新栏目的时候,照着程序已有原来的代码添加新的功能时,文件没有错误.点击新的栏目的时候报了java.lang.IllegalArgumentException: selectPageByExample is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries). 解决: 在网上查找了

【原创】Mapped Statements collection does not contain value for DaoImpl.method

问题: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.

Mapped Statements collection does not contain value for

Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原因有几种: 1.mapper.xml中没有加入namespace 2.mapper.xml中的方法和接口mapper的方法不对应 3.mapper.xml没有加入到mybatis-config.xml中(即总的配置文件),例外:配置了mapper文件的包路径的除外 4.mapper.xml文件名和所写的mapper名称不相同.

Mapped Statements collection does not contain value fo

Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原因有几种: 1.mapper.xml中没有加入namespace 2.mapper.xml中的方法和接口mapper的方法不对应 3.mapper.xml没有加入到mybatis-config.xml中(即总的配置文件),例外:配置了mapper文件的包路径的除外 4.mapper.xml文件名和所写的mapper名称不相同.

mybatis报错Mapped Statements collection does not contain value for com.inter.IOper

首页 > 精品文库 > mybatis报错Mapped Statements collection does not contain value for com.inter.IOper mybatis报错Mapped Statements collection does not contain value for com.inter.IOper 2015-04-09 浏览(52) [摘要:正在顺序挪用IOperation接心中的getAllItems方式时,涌现了以下毛病: Exception

Mybatis_IllegalArgumentException: Mapped Statements collection does not contain value for

java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for queryAllUser 可能原因是:resources路径下,mybatis-conf.xml中缺少了对应的mapper <mapper resource="com/bruce/geekway/model/xml/DemoMapper.xml" /> 另外需要注意: 1,

MyBatis:Mapped Statements collection does not contain value for xxx

完整错误信息: 十一月 03, 2015 10:01:08 上午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [springmvc] in context with path [/xinghe-platform-web] threw exception [Request processing failed; nested exception is org.mybati

Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for &hellip;

编译通过并且运行web成功后,访问的页面不需要连接数据库,不牵扯到反射调用实体类就不会报错, 报错内容如下: [WARNING] org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exce