SpringMVC:HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.util.Map

2016-8-11 diaba Spring





HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.util.Map

type Exception report

message Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.util.Map

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.util.Map
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause

org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.util.Map
	org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:346)
	org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:284)
	org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:107)
	org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:698)
	org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:668)
	org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:663)
	org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:180)
	org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
	org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
	com.sun.proxy.$Proxy27.selectByCondition(Unknown Source)
	com.fengjr.insurance.trade.service.impl.BDSkuServiceImpl.selectByConditon(BDSkuServiceImpl.java:93)
	com.fengjr.insurance.trade.service.impl.BDSkuServiceImpl.querySkuForShow(BDSkuServiceImpl.java:101)
	com.fengjr.insurance.trade.pc.controller.product.ProductSkuController.productDetail(ProductSkuController.java:38)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:606)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause

java.lang.IllegalArgumentException: Result Maps collection does not contain value for java.util.Map
	org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:797)
	org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:550)
	org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:344)
	org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:284)
	org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:107)
	org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:698)
	org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:668)
	org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:663)
	org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:180)
	org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
	org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
	com.sun.proxy.$Proxy27.selectByCondition(Unknown Source)
	com.fengjr.insurance.trade.service.impl.BDSkuServiceImpl.selectByConditon(BDSkuServiceImpl.java:93)
	com.fengjr.insurance.trade.service.impl.BDSkuServiceImpl.querySkuForShow(BDSkuServiceImpl.java:101)
	com.fengjr.insurance.trade.pc.controller.product.ProductSkuController.productDetail(ProductSkuController.java:38)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:606)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.62 logs.

Apache Tomcat/7.0.62



问题原因:mybatis的xml文件配置错误,resultMap="java.util.Map",正确的配置是resultType="java.util.Map"

分析:关键字resultType配置返回结果类型,而resultMap被认为是映射表的ID,会根据该ID查找映射表,没有查到,所以就报Could not find result map java.util.Map异常了


标签: springmvc

发表评论:

Powered by emlog 京ICP备15045175号-1 Copyright © 2022