错误信息:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.pingan.credit.dao.mapper.TdReportMapper.insertQueryLog

    at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:223)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:59)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
at com.sun.proxy.$Proxy44.insertQueryLog(Unknown Source)
at com.pingan.credit.TestService.TestTdCase.testQueryLog(TestTdCase.java:1014)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

一般是Mapepr.xml文件中文nameapce没有和mapper接口发生映射,导致mybatis绑定失败

检查namespace 绑定mapper.java的 路径是否正确

----------------------------2017/10/12 更新----------------------------

今天重构一些代码,由于移动了xml文件的位置 又出现这个原因了

分析:

spring 压根就没扫描到你xml文件的路径

解决: 使用通配符 **

    <bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<!-- 自动扫描Mapper.xml文件 -->
<property name="mapperLocations" value="classpath*:com/xxx/xxx/xxx/xml/**/*Mapper.xml"/>
</bean>

Mybatis 异常记录(1): Invalid bound statement (not found)的更多相关文章

  1. mybatis报错:Invalid bound statement (not found)

    mybatis报错:Invalid bound statement (not found)的原因很多,但是正如报错提示一样,找不到xml中的sql语句,报错的情况分为三种: 第一种:语法错误 Java ...

  2. Springboot项目下mybatis报错:Invalid bound statement (not found)

    mybatis报错:Invalid bound statement (not found)的原因很多,但是正如报错提示一样,找不到xml中的sql语句,报错的情况分为三种: 第一种:语法错误 Java ...

  3. MyBatis绑定错误--BindingException:Invalid bound statement (not found)

    如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper i ...

  4. MyBatis ognl.NoSuchPropertyException 或者 Invalid bound statement (not found)

    描述 SpringBoot + Mybatis-plus 项目,运行时出现如下错误: ognl.NoSuchPropertyException:没有对应属性异常 Invalid bound state ...

  5. mybatis 报错: Invalid bound statement (not found)

    错误: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): test.dao.Produc ...

  6. 13. 关于IDEA工具在springboot整合mybatis中出现的Invalid bound statement (not found)问题

    在一切准备就绪之后,测试test,却出现了org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) ...

  7. 解决IDEA中springboot整合mybatis中出现的Invalid bound statement(not found)的问题【转】

    感谢原博主,原文链接 : https://blog.csdn.net/benben513624/article/details/81076182 最近学习springboot的开发,中间磕磕碰碰也是遇 ...

  8. Mybatis plus 报错Invalid bound statement (not found) 终极解决办法

    我产生的错误原因是写的mapper继承BaseMapper没有添加泛型: 点进去: 为了解决这个bug,网上很多人也提出了解决办法:1.检查xml文件的namespace是否正确 2.Mapper.j ...

  9. MyBatis错误--Invalid bound statement (not found)

    今天在开发项目的时候使用MyBatis发生错误:Invalid bound statement (not found) 具体错误信息: org.springframework.beans.factor ...

随机推荐

  1. 【luogu P1268 树的重量】 题解

    题目链接:https://www.luogu.org/problemnew/show/P1268 给定所有点间的最短路求原图所有路径和 形如: 我们需要计算红边+绿边 绿边 = (红边+蓝边+紫边)/ ...

  2. Xcode DeviceSupport

    问题:Could not locate device support files. This iPhone 6s is running iOS 12.1 (16B5059d), which may n ...

  3. spring(一)-基本概念

    1.定义与特点 定义:一个分模块的一站式后台开发框架. 特征: (1)比起EJB,更轻量级别的容器框架,模块形式组织,只需要调用相应模块(jdbc.springmvc) (2)Spring IOC低耦 ...

  4. ios应用数据存储方式(归档) - 转

    一.简单说明  1.在使用plist进行数据存储和读取,只适用于系统自带的一些常用类型才能用,且必须先获取路径相对麻烦.  2.偏好设置(将所有的东西都保存在同一个文件夹下面,且主要用于存储应用的设置 ...

  5. oracle中connect by语句的优化

    很多应用中都会有类似组织机构的表,组织机构的表又通常是典型的层次结构(没有循环节点).于是通过组织控制数据权限的时候,许多人都喜欢通过connect by获得组织信息,然后再过滤目标数据. 在有些情况 ...

  6. Flask-SQLAlchemy安装及设置

    Flask-SQLAlchemy安装及设置 SQLALchemy 实际上是对数据库的抽象,让开发者不用直接和 SQL 语句打交道,而是通过 Python 对象来操作数据库,在舍弃一些性能开销的同时,换 ...

  7. 【Linux磁盘优化管理--RAID和LVM】

    在现阶段的企业环境中,为了数据的安全性及完整性必须要有一个合理的存储方案.面对着每秒可能产生超过几TB的数据,考虑到磁盘能不能实现 热冗余,及扩容,缩容.Linux给出了RAID(磁盘阵列)以及LVM ...

  8. 类的特殊方法"__new__"详解

    上代码! class A: def __new__(cls, *args, **kwargs): obj = super().__new__(cls) print("__new__ &quo ...

  9. 微信小程序scroll-viwe遇到的问题

    1.当使用scroll-view的时候里面不可以使用某些标签 2.当使用scroll-view的时候会出现,子元素中滑动的时候会出现滚动的情况,我遇到的是因为view设置了高度和行高,一旦设置了这个, ...

  10. Hive初识(一)

    LOAD DATA语句 一般来说,在SQL创建表后,我们就可以使用INSERT语句插入数据.但在Hive中,可以使用LOAD DATA语句来插入数据. LOAD DATA [LOCAL] INPATH ...