zoukankan      html  css  js  c++  java
  • [转载]Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample: 错误

    因碰到同样的问题,使用该方法对我有效,为方便以后查找,所以做了转载,原文请查看:https://www.cnblogs.com/fifiyong/p/5795365.html

    在Maven工程下,想通过controller接收url中的参数Id查询数据库的数据,并且以json形式显示在页面。

    在浏览器输入url后出现的问题:

    八月 22, 2016 1:45:22 下午 org.apache.catalina.core.StandardWrapperValve invoke
    严重: Servlet.service() for servlet [taotao-manager] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample] with root cause
    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample
     at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
     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.$Proxy30.selectByExample(Unknown Source)
    

    原因:找不到mapper的映射文件

     

    解决办法:

     <!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
     <build>
      <resources>
                <resource>
                    <directory>src/main/java</directory>
                    <includes>
                        <include>**/*.properties</include>
                        <include>**/*.xml</include>
                    </includes>
                    <filtering>false</filtering>
                </resource>
            </resources>
    
    </build>
    

    以上节点的内容,添加的位置在Maven工程下的父工程里面pom.xml文件中

    抱歉,我只能根据自己出现的情况说明了,希望能帮到出现同样错误的朋友,同时希望路过的牛人指点。

  • 相关阅读:
    搭建一个redis高可用系统
    从“如何设计用户超过1亿的应用”说起----数据库调优实战
    单表60亿记录等大数据场景的MySQL优化和运维之道 | 高可用架构
    信息安全系统和安全体系
    敏捷开发系列之旅 第五站(不一样的RUP统一软件开发过程)
    微服务理论与实践(三)-微服务架构的基本能力和优缺点
    学习“CC攻击”
    查看IIS错误日志
    ISNULL函数
    IE6/7下Select控件Display属性无效解决办法
  • 原文地址:https://www.cnblogs.com/cenyu/p/8955504.html
Copyright © 2011-2022 走看看