SpringBoot:Invalid bound statement (not found)的原因和解决方案

简介: SpringBoot:Invalid bound statement (not found)的原因和解决方案

🐓 报错信息:

(无效绑定声明)找不到

image.png

解析:

你的mapper实例对象和对应的mapper.xml对象未找到


🐓 排查:

情况一:

1.排除相对应的mapper实例对象路径是否正确

1278d8a05c5844788c7b32532c3209c5.png

查看相对应的mapper中的接口是否添加了@mapper注解且点击其跳转标志确认是否关联

f38f56c2311f436db77d4c871afe92c7.png

2.如果无法跳转,说明其mapper.xml和mapper实例对象路径可能绑定错误,导致的Invalid bound statement

768f2b68d77c4a54aed9c52dcced47e9.png

3.检查 mapper namespace的路径是否和其mapper实例类的路径是否一致

be33f56b886444b7881737ff2ed8bfaa.png

情况二:

application.properties文件问题

mybatis.mapper-locations=classpath:/priv/zhengfa/mapper/*.xml


情况三:

启动类扫描未扫到

@SpringBootApplication
@MapperScan("路径.mapper")
public class Application {
 
    public static void main(String[] args) {
        SpringApplication.run(Application.class,args);
    }
 
}


情况四:mapper.xml未放到指定的resource文件中,将其移动至其文件即可

b0a82c622acd4ed094e175bd6fa61b7e.png

相关文章
|
Java Spring
【Azure Developer】Springboot 集成 中国区的Key Vault 报错 AADSTS90002: Tenant 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found
【Azure Developer】Springboot 集成 中国区的Key Vault 报错 AADSTS90002: Tenant 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found
722 0
|
IDE Java Maven
Spring Boot启动失败问题:hile scanning for the next token found character '@'
Spring Boot启动失败问题:hile scanning for the next token found character '@'
1258 0
springboot之log4j:WARN No appenders could be found for logger
springboot之log4j:WARN No appenders could be found for logger
springboot之log4j:WARN No appenders could be found for logger
idea springboot无法自动装配Could not autowire. No beans of ‘Xxx‘ type found.
idea springboot无法自动装配Could not autowire. No beans of ‘Xxx‘ type found.
idea springboot无法自动装配Could not autowire. No beans of ‘Xxx‘ type found.
|
Java
springboot3 解决:Could not autowire. No beans of ‘JavaMailSender‘ type found
因为 spring-boot-starter-mail 默认使用某些包发生了变化,在 2.2.xx 版本前后不一,解决对应bug
1343 0
SpringBoot项目出现: Invalid bound statement (not found)可能原因
SpringBoot项目出现: Invalid bound statement (not found)可能原因
554 0
SpringBoot项目出现: Invalid bound statement (not found)可能原因
|
Java Spring
spring boot Configuration Annotation Proessor not found in classpath(贼简单)
spring boot Configuration Annotation Proessor not found in classpath(贼简单)
|
XML Java 数据库连接
springboot整合mybatis中:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
在项目的启动过程中如果出现:以下报错信息,则可以从以下几个方面入手排查问题。 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper interface和xml文件的定义对应不上,需要检查包名,namespace,函数名称等能否对应上,需要比较细致的对比,这是第二次出现这种异常。我每次都是按照如下方法去逐一排查的,到最后都能解决问题。
1913 0
|
JavaScript Java 关系型数据库
基于springboot的项目管理系统
本文探讨项目管理系统在现代企业中的应用与实现,分析其研究背景、意义及现状,阐述基于SSM、Java、MySQL和Vue等技术构建系统的关键方法,展现其在提升管理效率、协同水平与风险管控方面的价值。