解决报错:IncompleteElementException: Could not find result map...
2024-10-14 08:11:55
今天遇到这样一个报错,记录一下:
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
哈哈,有点小尴尬...
最新文章
- 原生JS 表单提交验证器
- uva 140 bandwidth (好题) ——yhx
- ThinkPHP之OAuth2.0环境搭建
- spring mvc 第一天【注解实现springmvc的基本配置】
- iis6|iis7|配置URLRewriter|64位操作系统下|.net2.0|.net4.0|配置URLRewriter|Web.config配置详情
- PRML读书会第六章 Kernel Methods(核函数,线性回归的Dual Representations,高斯过程 ,Gaussian Processes)
- 谷歌浏览器web开发教程之开始篇:使用sublime
- POJ 1873 The Fortified Forest [凸包 枚举]
- python全栈开发-Day3 字符串
- thinkphp5.0--编写api,返回json格式
- 【python】——sql模拟
- leetcode23
- Qt 编程指南 4 单行编辑控件
- HTML响应状态码
- Windows下adobe Reader中pdf字体helvetica被替换为ArialMT
- LINQ 图解 LINQ学习第三篇
- 软件包管理:rpm命令管理-包命名与依赖性
- 编译时:virtual memory exhausted: Cannot allocate memory(转)
- JSP开发中对jstl的引用方式(标签库引用)
- 【Atcoder】AGC 020 D - Min Max Repetition 二分+构造