在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文件中

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

最新文章

  1. Hadoop中Combiner的使用
  2. tableview详细介绍
  3. Android中使用ShareSDK实现分享
  4. makefile--目标搜索(八)
  5. Linux下的动态连接库及其实现机制
  6. [IOI1999]花店橱窗布置(DP路径记录)
  7. Jmeter录制脚本工具之chrome插件--BlazeMeter
  8. 使用XmlWriter创建XML文件
  9. 让SAE下的wordpress支持文件上传
  10. 了解vue里的Runtime Only和Runtime+Compiler
  11. linux coredump开启
  12. browse-agent type and curl post
  13. C语言强化——文件
  14. Java 使用 jacob 将 word 文档转换为 pdf 文件
  15. 《Linux内核设计与实现》 第三周 读书笔记
  16. arcmap搜索脚本错误
  17. ubuntu下上传本地代码到github
  18. Java项目性能持续优化中……
  19. NOIP模拟1
  20. 持续集成(CI – Continuous Integration)

热门文章

  1. 利用HADOOP中的jar写一个RPC
  2. krpano之背景音乐
  3. SDL_AudioSpec(转)
  4. pom.xml配置指定仓库
  5. IP定位,天气接口
  6. 百度Ueditor编辑器取消多图上传对话框中的图片搜索
  7. struts2 与 spring 整合
  8. Ubuntu 源使用帮助
  9. 怎样去阅读一份php源代码
  10. C# Code 非常好的学习博客