-
Mapper接口与Mapper.xml文件不匹配(找不到)
a. 原作者,blog链接:Invalid bound statement (not found)出现原因和解决方法_陈大豆的博客-优快云博客
b. 验证xml中的namespace是否为Mapper接口的全名称,如com.helloword.mapper.AdminMapper(找到Mapper接口,右键复制reference)
c. 验证xml中的id与接口中的方法名是否一致(仔细校验)
d. 检查pom.xml中的build下是否配置好了资源`<build> <resources> <!--Mapper与其xml放在同目录下情况--> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> <!--Mapper的xml放在resources目录下情况--> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources> <build>`
e.上面看完还不行的话,验证一下target(Application运行后生成的文件夹)是否包含Mapper与相应的xml,如果没有,执行maven中的clean,再重新运行Application。
Invalid bound statement (not found)解决方法(个人笔记)
最新推荐文章于 2025-03-10 23:41:32 发布