知识改变命运! mybatis BindingException: Invalid bound statement (not found):汇总_猿份哥-lskyf博客社区

mybatis BindingException: Invalid bound statement (not found):汇总

猿份哥 1年前 ⋅ 1330 阅读 ⋅ 4 个赞

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example...... 发生这样的问题原因有以下几点

1.mapper接口类全名与mapper.xml的namespace不一致

2.mapper接口的方法与mapper.xml的id不一致

3.mapper.xml的中文注释造成(去掉中文注释)

4.mapper.xml的路径与配置的不一致

例如:

 mapper.xml位置在resources/mapper/mapper.xml但是你的mybatis配置确是
 (mybatis:
   mapperLocations: classpath:mapper/*/*.xml)
 这样只能扫描到不到mapper/mapper.xml
 正确的配置是
 mybatis:
   mapperLocations: classpath:mapper/*.xml或者将mapper.xml放到resources/mapper/*/mapper.xml的位置(*表示任何文件夹名称)

5.idea中的resources有个标志如果没有则需要设置成resources

选择file-->Project Structure-->Moudules-->选择项目的resources文件夹-->点击Resources-->ok

6.注解或者xml的sql语句的特殊符号导致的语法不正确

 > 使用>替换
 < 使用&lt;替换
 >= 使用&gte;替换
 <= 使用&lte;替换
 "使用&quot;替换
 '使用&apos;替换
 
 xml当中使用<![CDATA[]]>包裹特殊符号不会被解析

全部评论: 0

    我有话说:

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

    发生这样的问题原因有以下几点 1.mapper接口类全名与mapper.xml的namespace不一致 2.mapper接口的方法与mapper.xml的id不一致 3.mapper.xml的中文注释造成(去掉中文注释) 4.mapper.xm...

    idea离线安装better-mybatis-generator

    1.idea离线安装better-mybatis-generator 2.下载better-mybatis-generator 浏览器输入链接http://plugins.jetbrains.com

    mybatis 映射属性部分值为null的另一种特殊情况

    今天遇到一个问题mybatis映射到Java属性部分数据没有值为null 表现其他Integer类型都有值,唯独String类型没有值 疑问一个简单的映射为什么没有值呢?平时都是这样干的。都没有问题

    chatgpt入口汇总

    各路chatgpt入口汇总,持续更新中 chatgpt(openai) https://chat.openai.com/ new bing(微软) https://bing.com/new bard

    Spring Boot系列7-SpringBoot+mybatis+druid+TypeHandler

    介绍在SpringBoot中集成mybatis和druid以及自定义TypeHandler 创建数据库表 SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- --------------------...

    chrome 离线扩展程序安装报错 程序包无效:"CRX_HEADER_INVALID"

    安装chrome离线扩展程序时候报错:程序包无效:"CRX_HEADER_INVALID"导致crx扩展程序无法正常安装。 怎么办呢? 解决方法:将crx文件后缀.crx改为.zip然后重新拖进

    .NoHandlerFoundException: No handler found for GET

    今天做了一件特别傻的事:哈哈哈!如果你看到这个。我就不孤独了,谢谢你!我们都傻到一起了! 问题 ExceptionHandlerExceptionResolver : Resolved [org.springframework.web.servl...

    微信小程序报错request:fail url not in domain list

    微信小程序报错request:fail url not in domain list 登录小程序后台 https://mp.weixin.qq.com/ 选择开发--开发设置--服务器域名--服务器

    vue3报错:Uncaught TypeError: this.$refs.demo.$on is not a function

    错误 Uncaught TypeError: this.$refs.demo.$on is not a function 原因 Vue 3 中,$on 方法已经被移除,可能需要使用

    springboot kotlin No default constructor for entity

    org.springframework.orm.jpa.JpaSystemException: No default constructor for entity: 正如JPA所要求的那样

    because there's not enough pre

    这个错误是什么问题? 运行stable duffusion出现这个错误 NansException: A tensor with all NaNs was produced in Unet. This could be either becaus...

    加入公众号
    加入公众号