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

  <!-- mybatis 配置-->
<!--spring和mybatis完美结合,不需要mybatis配置映射文件-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<!--mapperLocations:它表示我们的Mapper文件存放的位置,
当我们的Mapper文件跟对应的Mapper接口处于同一位置的时候可以不用指定该属性的值。
mapper文件就是xml文件-->
<!--自动扫描mapper.xml文件--> <property name="mapperLocations">
<array>
<value>classpath:mapper/country/*.xml</value>
<value>classpath:mapper/order/*.xml</value>
<value>classpath:mapper/product/*.xml</value>
<value>classpath:mapper/user/*.xml</value>
<value>classpath:mapper/BrandDao.xml</value>
</array>
</property>
<!--这个可以实现上面一样的功能-->
<!-- <property name="mapperLocations" value="classpath*:mapper/**/*.xml"/>-->
<!--这个query 一定研究一下 用处好大啊!!-->
<property name="typeAliasesPackage" value="cn.biye.core.bean,cn.biye.core.query"/>
</bean> <!-- 扫包 -->
<!-- DAO接口所在包名,Spring会自动查找其下的类 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!--下面这个value可以有两种写法:1,精确到各个包下面,多个包用逗号隔开。
2,不精确到每个包下面,就只写到各个包上面的包中,例如dao包下面还有包,则写到dao就行了-->
<property name="basePackage" value="cn.biye.core.dao.user,
cn.biye.core.dao.product,cn.biye.core.dao.order,cn.biye.core.dao.country"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>

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

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

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

关于maven构建spring+Mybatis工程运行错误:
org.apache.ibatis.binding.BindingException: Invalidbound statement (not found):
在网上找了一些帖子和博文,发现可能是在打包时没有打包mapper.xml文件。最后到target下看,果然在对于的package下没有mapper.xml文件。
针对idea下没有打包package下的mapper.xml的解决方法:
在maven的pom.xml文件的<build>节点下告诉maven我们需要打包的文件: 最后可以在target下看看是否我们编写的mapper.xml文件被打包没有。
总结一下org.apache.ibatis.binding.BindingException: Invalidbound statement (not found):的大多数原因:
1. 先检查自己的mapper.xml文档是否在Mybatis的配置文件中是否加载了。
2. 查看mapper.xml文件中namespace的命名空间是否和接口的类的全名称相同
3. 查看mapper.xml文件中sql语句的id名称是否和接口中的方法名称一致。
4. Sql语句中的参数和返回类型和接口中的参数和返回值类型相同
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. 语音转文字小工具开发Python

    # -*- coding: utf- -*- import requests import re import os import time from aip import AipSpeech fro ...

  2. 利用CSS 修改input=radio的默认样式(改成选择框)

    html部分: <input id="item2" type="radio" name="item"> <label fo ...

  3. Linux - iptables firewalld

    目录 iptables firewalld iptables 1.iptables 的基本使用 启动: service start iptabls 关闭: service stopiptabls 查看 ...

  4. SpringMVC初写(五)拦截器

    在系统开发过程中,拦截器的使用可以使我们实现一些需求.如:登录认证,权限管理等,拦截器的工作核心就是将一些工作流程进行统一处理 拦截器和过滤器的区别: 过滤器过滤的是请求路径,拦截器拦截的各层方法的映 ...

  5. DB2 close auto commit

    db2 关闭命令行CLP自动提交 --临时关闭自动提交 #db2 "update command options using C off --永久关闭自动提交 ----linux 环境下 # ...

  6. Android对敏感数据进行MD5加密(基础回顾)

    1.在工具类的包下新建一个进行md5加密的工具类MD5Utils.java package com.example.mobilesafe.utils; import java.security.Mes ...

  7. Sublime Text3 快捷键总结

    Sublime Text3 快捷键总结 多行快速选择文本 Ctrl+D:选中光标所占的文本,继续操作则会选中下一个相同的文本.(非常实用)Ctrl-K, Ctrl-D:把当前选中所占文本的光标,跳转到 ...

  8. flask框架的学习

    ---恢复内容开始--- 第一个flask程序讲解:1. 第一次创建项目的时候,要添加flask的虚拟环境.添加虚拟环境的时候,一定要选择到python这个执行文件.比如你的flask的虚拟环境的目录 ...

  9. SQL Server中用While循环替代游标(Cursor)的解决方案

    By行处理数据,推荐2种方式: 1.游标 2.While循环 我们来了解下这两种方案处理1w行数据分别需要多长时间. 一.游标. 首先我们填充一个表,用优雅的递归方式填充. ,) ) ;with ct ...

  10. [转]OData and Authentication – Part 6 – Custom Basic Authentication

    本文转自:https://blogs.msdn.microsoft.com/astoriateam/2010/07/21/odata-and-authentication-part-6-custom- ...