异常信息:
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写错。