mybatis的坑:org.apache.ibatis.builder.IncompleteElementException: Could not find result map xxxxxxxxxxxxxxxxxx(各种类型)
org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map xxxxxxxxxxxxxxxxxx(各种类型)
mybatis在执行CRUD的时候会解析mybatis的所有xml文件,当解析resultMap属性值时,发现其属性值并不存在,则抛出org.apache.ibatis.builder.IncompleteElementException异常。
同样,当解析rparameterType属性值时,发现其属性值并不存在,也会抛出org.apache.ibatis.builder.IncompleteElementException:Could not find parameter map xxxxxxxxxxxxxxxxxx(各种类型)异常。
这里需要注意的是有时异常堆栈输出的错误代码位置并不是正在出错的地方,因为它会解析mybatis的所有xml文件。
解决:
1.首先检查resultMap是不是应该写成resultType;
2.认真检查resultMap的值是不是拼写错了,有没有定义。