今天遇到这样一个报错,记录一下:

org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xxx.manager.mapper.ItemMapper.Item

    at org.apache.ibatis.builder.MapperBuilderAssistant.getStatementResultMaps(MapperBuilderAssistant.java:346)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:290)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:109)
at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:788)
at org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:758)
at org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:753)
at org.apache.ibatis.binding.MapperMethod$SqlCommand.resolveMappedStatement(MapperMethod.java:247)
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:217)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
at com.sun.proxy.$Proxy22.select(Unknown Source)
at com.xxxx.manager.service.impl.BaseServiceImpl.getList(BaseServiceImpl.java:97)
at com.xxxx.manager.service.impl.BaseServiceImpl$$FastClassBySpringCGLIB$$dae8e2b1.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.xxxx.manager.service.impl.ItemServiceImpl$$EnhancerBySpringCGLIB$$5180168e.getList(<generated>)
at com.xxxx.manager.TestMybaitsMapper.testGetList(TestMybaitsMapper.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.xxxx.manager.mapper.ItemMapper.Item
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:888)
at org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:640)
at org.apache.ibatis.builder.MapperBuilderAssistant.getStatementResultMaps(MapperBuilderAssistant.java:344)
... 48 more

最后发现是:把 resultType 写成了 resultMap

哈哈,有点小尴尬...

最新文章

  1. python Unicode 编码解码
  2. Neutron 理解 (7): Neutron 是如何实现负载均衡器虚拟化的 [LBaaS V1 in Juno]
  3. word多级编号,如何让第一级为大写&ldquo;一&rdquo;,其他级别均为小写1.
  4. 《FLASH CC 2015 CANVAS 中文教程》——2、基本的交互(点击、触摸)事件
  5. SPOJ #2 Prime Generator
  6. c# await 关键字错误
  7. mysql 数据库性能追踪与分析
  8. Ubuntu系统安装stardict(星际译王)词典
  9. 字符串分割函数Demo
  10. java多线程编程核心技术——第二章
  11. Centos6.8 编译安装Apache2.4
  12. NOIp2014提高组初赛错题简析
  13. 使用路由传参时,query与params的区别!
  14. 【本地服务器】json-server搭建本地https服务器(windows)
  15. 实验八 Web基础
  16. Vue.js 相关知识(脚手架)
  17. Mac上删除不了的文件,Windows上也粉碎不了怎么办?
  18. Spring注解方式配置说明
  19. JAVA注释方式
  20. win10 程序crash后弹出 XXX已停止工作

热门文章

  1. C# tostring
  2. iOS 中 .a 和 .framework 静态库的创建与 .bundle 资源包的使用
  3. continue,break以及加上标签的使用(goto思路)
  4. pymysql 模块介绍
  5. 解释器模式(Interpreter)
  6. 《Linux命令行与shell脚本编程大全》第二十二章 gawk进阶
  7. JAVA8新特性(一)
  8. CCF-201512-1-数位之和
  9. Python学习之--socket
  10. Web前端学习——CSS