mybatis常见错误汇总

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis常见错误汇总相关的知识,希望对你有一定的参考价值。

1、Result Maps collection does not contain value for 

Caused by: org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.business.entity.RepayChannel
at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:346)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:284)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:107)
at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:698)
at org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:668)
at org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:663)
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:180)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
at com.sun.proxy.$Proxy29.selectResourcess(Unknown Source)
at com.cardniu.ccrepayment.service.system.impl.ResourcesServiceImpl.selectResourcess(ResourcesServiceImpl.java:99)
at com.cardniu.ccrepayment.service.system.impl.ResourcesServiceImpl$$FastClassBySpringCGLIB$$fd86be84.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:43)
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:653)
at com.cardniu.ccrepayment.service.system.impl.ResourcesServiceImpl$$EnhancerBySpringCGLIB$$2309954f.selectResourcess(<generated>)
at com.cardniu.ccrepayment.shiro.ChainDefinitionSectionMetaSource.getObject(ChainDefinitionSectionMetaSource.java:39)
at com.cardniu.ccrepayment.shiro.ChainDefinitionSectionMetaSource.getObject(ChainDefinitionSectionMetaSource.java:1)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
... 29 more
Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.business.entity.RepayChannel
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:797)
at org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:550)
at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:344)
... 55 more

原因:resultType写成resultMap

resultMap后面接mapper.xml定义的列集合,

resultType后面才能接具体的类

<select id="selectChannel" resultMap="com.business.entity.RepayChannel">


































以上是关于mybatis常见错误汇总的主要内容,如果未能解决你的问题,请参考以下文章

mybatis常见错误

Quartus II 中 Verilog 常见警告/错误汇总

实战福利:Spark 常见错误问题汇总

django 常见错误汇总

Maven项目常见错误解决方法汇总

ubuntu 内核升级过程中常见错误以及解决方法汇总