在用maven配置mybatis环境时出现此BindingExceptiony异常,发现在classes文件下没有mapper配置文件,应该是maven项目没有扫描到mapper包下的xml文件,
在pom.xml中加入一下代码可以解决:

1.首先在pom.xml中,将xxxmapper.xml添加到类路径下

 <build><resources>  <!-- maven项目中src源代码下的xml等资源文件编译进classes文件夹,注意:如果没有这个,它会自动搜索resources下是否有mapper.xml文件,如果没有就会报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.pet.mapper.PetMapper.selectByPrimaryKey--><resource>  <directory>src/main/java</directory>  <includes>  <include>**/*.xml</include>  </includes>  </resource>  <!--将resources目录下的配置文件编译进classes文件  -->  <resource><directory>src/main/resources</directory></resource></resources>  </build>

2.在配置文件中,指定mapper文件所在路径
#mybatis的配置文件

mybatis.config-location=classpath:/mybatis-config.xml
mybatis.mapper-locations=classpath:**/dao/**.xml

springboot整合Mybatis提示org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)相关推荐

  1. ssm整合 报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):xxx

    目录 1. 报错原因 2. 解决 3. 说明 1. 报错原因 使用MapperScannerConfigurer扫描对应的mapper接口,帮我把mapper放入spring容器中,但是我的mappe ...

  2. 总结mybatis plus解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)方法

    总结解决 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)方法 问题背景:在做Spring ...

  3. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zzq.springboot.

    这个bug的原因大多都是代码和xml配置文件没配对好.如果你和我一样,使用Spring boot + mybatis 开发,同时也是全程使用注解,你可以看看我的解决方案! 出现问题: org.apac ...

  4. mybatis找不到xml中的方法;org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    mybatis配置mapper对的.配置dao对的.配置都是对的,但是就是发现不了方法,那就是xml找到的问题了,在群友的提示下找到target/classes文件夹里根本没有xml文件.故找到原因: ...

  5. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zyh.springboot.

    超详细-springboot+mybatisplus使用xml找不到mapper的解决办法 org.apache.ibatis.binding.BindingException: Invalid bo ...

  6. mybatis配置时出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)...

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

  7. mybatis-plus自定义mapper报org.apache.ibatis.binding.BindingException: Invalid bound statement(not found)

    今天在springboot的项目中,需要用到自定义的mapper,之前一直使用mybatis-plus自动生成的mapper,一直可以正常使用,今天因为需求需要,自定义了mapper,但是一直报这个错 ...

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

    spring+mybatis 提示以下错误: org.apache.ibatis.binding.BindingException: Invalid bound statement (not foun ...

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

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. org.apache.ibatis.binding.BindingException: Invali ...

最新文章

  1. html下拉框由后端,select下拉框通过ajax获取后台的值
  2. 评分卡开发方法论scorecard
  3. python构建区块链_用python构建区块链(1)---基本结构
  4. win10 mysql登录密码忘了_64位 windows10,MYSQL8.0.13重置密码(忘记密码或者无法登录)...
  5. c# 带返回值的action_C#基础知识之Func和Action学习
  6. java三年面试题(分布式篇)不定期更新
  7. xsd是什么文件,作用是什么?
  8. Linux上安装rz、sz命令
  9. 好用的dns服务器工具有哪些?
  10. 解决IE浏览器的Automation 服务器不能创建对象的问题
  11. 删除MAC电脑中卸载PS后在launchpad中残留的图标
  12. 开发一个小程序商城需要多少钱?
  13. 网上大多数原理总结,UDP打洞原理
  14. easyui treegrid
  15. 演讲实录|OpenMLDB 与阿里云 MaxCompute 生态集成
  16. 时间序列预测方法_让我们使用经典方法预测您的时间序列
  17. 30岁转行做程序员是一种怎样的体验?
  18. Java入门篇(一)——如何编写一个简单的Java程序
  19. 传统业务上云:跨AZ容灾架构解析
  20. 【Django毕业设计源码】Python旧衣物捐赠系统的设计与实现

热门文章

  1. hive安装mysql驱动_Hadoop-2.6.0为基础的Hive安装
  2. ansys 内聚力_内聚力 软件工程
  3. ruby hash方法_Ruby中带有示例的Hash.key?(obj)方法
  4. Java GregorianCalendar hashCode()方法与示例
  5. android 集成x5内核时 本地没有,腾讯浏览服务-接入文档
  6. 查看 mysql 状态_查看mysql状态的常用命令
  7. 4 曝光_荣耀户外手表GS Pro曝光:超强续航 9月4日发布
  8. 5种SpringBoot热部署方式,你用哪种?
  9. MySQL 性能优化 分布式
  10. 计算机操作系统原理教程与实训(目录)