在一个mybatis的xml里面新增了一个方法,然后再次启动,只要是查数据库的地方全都是报这个错,即使是与我新增加的这个方法所在的表无关的查询也会报这个错。
严重: Servlet.service() for servlet [applicationContext] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.journey.dao.mapper.AbcTourProductMapper.selectSelectiveByPage] with root cause
java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.journey.dao.resultdao.AreaDAO
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:775)
at org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:534)
at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:363)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:303)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:109)
at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:682)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:613)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:608)
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:176)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:38)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)
at com.sun.proxy.$Proxy28.selectSelectiveByPage(Unknown Source)
at com.journey.biz.impl.ProductServiceImpl.selectSelectiveByPage(ProductServiceImpl.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201)
at com.sun.proxy.$Proxy30.selectSelectiveByPage(Unknown Source)
at com.admin.controller.ProductController.themeTripList(ProductController.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
后来发现是将resultType写成了resultMap
两者(resultMap、resultType)的区别:
http://www.tuicool.com/articles/ju2Y7n
另外parameterMap