• 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写错。

  • 相关阅读:
    LeetCode Single Number
    Leetcode Populating Next Right Pointers in Each Node
    LeetCode Permutations
    Leetcode Sum Root to Leaf Numbers
    LeetCode Candy
    LeetCode Sort List
    LeetCode Remove Duplicates from Sorted List II
    LeetCode Remove Duplicates from Sorted List
    spring MVC HandlerInterceptorAdapter
    yum
  • 原文地址:https://www.cnblogs.com/thinkingandworkinghard/p/8183968.html
Copyright © 2020-2023  润新知