1. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
  2.  
  3. <!-- mybatis 配置-->
  4. <!--springmybatis完美结合,不需要mybatis配置映射文件-->
  5. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  6. <property name="dataSource" ref="dataSource" />
  7. <!--mapperLocations:它表示我们的Mapper文件存放的位置,
  8. 当我们的Mapper文件跟对应的Mapper接口处于同一位置的时候可以不用指定该属性的值。
  9. mapper文件就是xml文件-->
  10. <!--自动扫描mapper.xml文件-->
  11.  
  12. <property name="mapperLocations">
  13. <array>
  14. <value>classpath:mapper/country/*.xml</value>
  15. <value>classpath:mapper/order/*.xml</value>
  16. <value>classpath:mapper/product/*.xml</value>
  17. <value>classpath:mapper/user/*.xml</value>
  18. <value>classpath:mapper/BrandDao.xml</value>
  19. </array>
  20. </property>
  21. <!--这个可以实现上面一样的功能-->
  22. <!-- <property name="mapperLocations" value="classpath*:mapper/**/*.xml"/>-->
  23. <!--这个query 一定研究一下 用处好大啊!!-->
  24. <property name="typeAliasesPackage" value="cn.biye.core.bean,cn.biye.core.query"/>
  25. </bean>
  26.  
  27. <!-- 扫包 -->
  28. <!-- DAO接口所在包名,Spring会自动查找其下的类 -->
  29. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  30. <!--下面这个value可以有两种写法:1,精确到各个包下面,多个包用逗号隔开。
  31. 2,不精确到每个包下面,就只写到各个包上面的包中,例如dao包下面还有包,则写到dao就行了-->
  32. <property name="basePackage" value="cn.biye.core.dao.user,
  33. cn.biye.core.dao.product,cn.biye.core.dao.order,cn.biye.core.dao.country"/>
  34. <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
  35. </bean>

在这一点上面经常报错,可以肯定的是,把路径都详细指到位肯定是不会错的,但因为我赖得写全路径,所以就报莫名其妙的500,还写上一大堆参数未绑定,

无法注入bean也都是这个问题,,,最准确一点是报:在实现层找不到可以注入的dao   can not autowire. No beans of 'FeatureDao"   其实也是它。

  1. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
  2.  
  3. 关于maven构建spring+Mybatis工程运行错误:
  4. org.apache.ibatis.binding.BindingException: Invalidbound statement (not found):
  5. 在网上找了一些帖子和博文,发现可能是在打包时没有打包mapper.xml文件。最后到target下看,果然在对于的package下没有mapper.xml文件。
  6. 针对idea下没有打包package下的mapper.xml的解决方法:
  7. mavenpom.xml文件的<build>节点下告诉maven我们需要打包的文件:
  8.  
  9. 最后可以在target下看看是否我们编写的mapper.xml文件被打包没有。
  10. 总结一下org.apache.ibatis.binding.BindingException: Invalidbound statement (not found):的大多数原因:
  11. 1 先检查自己的mapper.xml文档是否在Mybatis的配置文件中是否加载了。
  12. 2 查看mapper.xml文件中namespace的命名空间是否和接口的类的全名称相同
  13. 3 查看mapper.xml文件中sql语句的id名称是否和接口中的方法名称一致。
  14. 4 Sql语句中的参数和返回类型和接口中的参数和返回值类型相同
  15. 5 最后查看生成的target中是否有对于的mapper.xml文件(如果上面都检查没有问题,那一般就是mapper.xml文件没有打包到target中)解决方法:

  

配置文件出错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):的更多相关文章

  1. 问题解决 : org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

    问题分析: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): ,即在mybatis中da ...

  2. 关于org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.atguigu.crud.dao.DepartmentMapper.insertSelective的错误

    今天我在使用mybatis逆向工程的时候,由于一个疏忽字打错了..结果花了一早上才把错误找全..广大小伙伴们一定要小心啊(能复制粘贴就别手打) 关于org.apache.ibatis.binding. ...

  3. Exception:HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    主要错误信息如下: HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...

  4. IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    有时候解决问题不仅仅是解决问题.-----jstarseven 最近因为开发需要,需要搭建一个ssm开发框架,采用了开发工具IDEA. 整合完了SSM开发框架之后,发布的时候出现org.apache. ...

  5. Java学习-052-(mybatis+mysql)访问接口时提示:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    在配置mybatis,访问接口提示: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),部 ...

  6. Spring扫面路径配置不全导致异常 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 的原因

    运行Junit测试类 package cn.bgodata.x.zero.service; import org.junit.Test; import org.junit.runner.RunWith ...

  7. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误几种解决方案

    报错信息: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.study.ser ...

  8. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 问题解决方法

    在用maven配置mybatis环境时出现此BindingExceptiony异常,发现在classes文件下没有mapper配置文件,应该是maven项目没有扫描到mapper包下的xml文件,在p ...

  9. idea 单元测试 mybatis spring-test 异常: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    因为在idea中必须在test下才能进行单元测试,所以进行单元测试时,ssm的项目会因为找不到resourece中的配置文件而报错 这里 org.apache.ibatis.binding.Bindi ...

随机推荐

  1. 算法图解学习笔记01:二分查找&大O表示法

    二分查找 二分查找又称折半查找,其输入的必须是有序的元素列表.二分查找的基本思想是将n个元素分成大致相等的两部分,取a[n/2]与x做比较,如果x=a[n/2],则找到x,算法中止:如果x<a[ ...

  2. [转] 两个静态html页面传值方法的总结

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/csdn_ds/article/details/78393564 问题 因最近尝试实现客户端与服务端分 ...

  3. 修改hosts文件的脚本1.0

    import sys IP_input = input("Please input IP:")DNS_input = input("Please input Domain ...

  4. Android事件分发和消费机制(转载)

    原文链接:http://www.cnblogs.com/sunzn/archive/2013/05/10/3064129.html Android 中与 Touch 事件相关的方法包括:dispatc ...

  5. SQL中动态进行行转列

    课程表 CREATE TABLE [dbo].[demo_Course]( [Cid] [uniqueidentifier] NOT NULL, ) NULL, CONSTRAINT [PK_demo ...

  6. mono for android 第四课--提示框(转)

    其实在VS中开发安卓代码和C#还是有一些相似性,刚开始我也不知道怎么弹出提示框,于是就百度了下,再加上个人的小聪明得到一下结果 builder.setTitle表示提示框的标题. setMessage ...

  7. MyBatis异常总结

    1 Invalid bound statement 1 org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...

  8. 1-2 Mobx 入门实践之TodoList(官方Demo)

    第一步:导入模块 import React, { Component } from 'react'; import { observable, autorun,computed } from 'mob ...

  9. 腾讯云技术专家卢萌凯手把手教你Demo一个人脸识别程序!

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文来自腾讯云技术沙龙,本次沙龙主题为Serverless架构开发与SCF部署实践 卢萌凯:毕业于东南大学,曾就职于华为,熟悉云行业解决方案 ...

  10. java调用ruby代码

    问题: 最近在做一个应用的时候碰到了一个问题.客户端需要调用服务器端传回的脚本信息,然后执行.其中脚本类型包括ruby.而java中调用ruby的代码大致如下: String jrubyCode=&q ...