mybatis报错:org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map

异常信息:
org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.boco.fsmsys.amuse.dao.AmuseItemDao.amuseItem
at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.Java:326)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:290)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:110)
…//省略
Caused by: java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for com.boco.fsmsys.amuse.dao.AmuseItemDao.amuseItem
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:660)
at org.apache.ibatis.session.Configuration.getParameterMap(Configuration.java:442)
at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:324)
… 45 more
原因:
异常信息容易让人产生误导,实际上这是因为在另一个Mapper.xml里将parameterType写成了parameterMap,而mybaties中已经不再用这个属性了。

<select id=”getClassByID” parameterMap=”String” resultMap=”classResultMap”>

测试确实如此,其实可能是同一个xml的另外一个select的parameterType或者resultMap写错。

    原文作者:Doyourself!
    原文地址: https://www.cnblogs.com/thinkingandworkinghard/p/8183968.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞