mybatis整合springmvc时的错误org.apache.ibatis.binding.BindingException: Invalid bound statement (not found
2016-07-31 10:24
951 查看
今天在调试mybatis,新增一个搜索功能的时候报了一个这个错误
<span style="white-space:pre"> </span>rg.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException:
网上一番搜索,得出答案如下:
1、请检查你的**mapper.xml值配置的namespace有没有对应上你的interface借口,请注意,是要完全对应上
<span style="white-space:pre"> </span><!-- 绑定接口 -->
<span style="white-space:pre"> </span><mapper namespace="com.weitongming.mapper.BrandMapper">
大家可以在定义的时候习惯性的按ctrl,再把鼠标移上去,如果能有点击超链接的效果,那么意味着你的配置文件是能访问到源文件的,说明起码语法没错。
2、在xml值之中配置的方法在接口之中不存在,执行的时候也会报错
3、请注意返回值的类型,如果接口返回的对象是个list,那么xml配置的select的resultMap一定要配置,不能配置resultType
<span style="white-space:pre"> </span>rg.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException:
Invalid bound statement (not found): com.weitongming.mapper.BrandMapper.queryBrandsByName org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:980) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844) 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:121) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.apache.logging.log4j.core.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:66) root cause
网上一番搜索,得出答案如下:
1、请检查你的**mapper.xml值配置的namespace有没有对应上你的interface借口,请注意,是要完全对应上
<span style="white-space:pre"> </span><!-- 绑定接口 -->
<span style="white-space:pre"> </span><mapper namespace="com.weitongming.mapper.BrandMapper">
<span style="white-space:pre"> </span>//接口定义
<span style="white-space:pre"> public interface BrandMapper {</span>}
大家可以在定义的时候习惯性的按ctrl,再把鼠标移上去,如果能有点击超链接的效果,那么意味着你的配置文件是能访问到源文件的,说明起码语法没错。
2、在xml值之中配置的方法在接口之中不存在,执行的时候也会报错
3、请注意返回值的类型,如果接口返回的对象是个list,那么xml配置的select的resultMap一定要配置,不能配置resultType
相关文章推荐
- mybatis使用时org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):的错误
- MyBatis典型的错误org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- spring boot 整合mybatis org.apache.ibatis.binding.BindingException: Invalid bound statement(not found)
- ssm整合出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- mybatis maven打包出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- mybatis绑定错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- spring+mybatis整合报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- 关于mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 错误的问题。
- mybatis绑定错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis绑定错误org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- 当mybatis整合spring后出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 关于mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 错误的问题
- 关于mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 错误的问题。
- Maven 遇到mybatis 发生org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- spring mybatis集成报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- MyBatis Error:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)(IDEA)
- 关于mybatis的org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 关于整合SSH,出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误