mybatis+spring tomcat启动时报错Mapped Statements collection already contains value for com.**.insertMenu!selectKey

发布于 2021-11-18 07:58:39 字数 2479 浏览 817 评论 2

Caused by: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.rx.mapper.SecurityMapper.insertMenu!selectKey
at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:98)
at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 50 more
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.rx.mapper.SecurityMapper.insertMenu!selectKey
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:657)
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:629)
at org.apache.ibatis.session.Configuration.addMappedStatement(Configuration.java:462)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:296)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$SelectKeyHandler.handleNode(XMLStatementBuilder.java:221)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseSelectKey(XMLStatementBuilder.java:167)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:91)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parsePendingStatements(XMLMapperBuilder.java:171)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:95)
at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.loadXmlResource(MapperAnnotationBuilder.java:138)
at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parse(MapperAnnotationBuilder.java:111)
at org.apache.ibatis.binding.MapperRegistry.addMapper(MapperRegistry.java:60)
at org.apache.ibatis.session.Configuration.addMapper(Configuration.java:532)
at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:95)

... 53 more


这么写有问题吗?去掉selectKey运行tomcat不会报错....有谁知道的,可以说下吗?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

瑾夏年华 2021-11-21 00:05:03

感谢你的回复...终于找到问题的所在了...parameterMap改成parameterType...真的是粗心了我...

心舞飞扬 2021-11-20 14:53:02

http://www.cnblogs.com/yangchao/archive/2010/09/28/2044415.html

<selectKey resultClass="long" keyProperty="id"> 
       select SEQ_USER_ID.nextval as id from dual 
</selectKey>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文