全面解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
程序员文章站
2022-05-01 14:46:47
...
问题截图:
问题可能原因:
1、这一点很重要:就是在pom.xml没有插件或者没有开启在java目录下的xml、properties文件扫描
<build>
<!--目的是把src/main/java目录中的xml文件包含到输出结果中。输出到classes目录中-->
<resources>
<resource>
<directory>src/main/java</directory><!--所在的目录 -->
<includes>
<!--包括目录下的.properties、.xml文件都会扫描-->
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
2、一定注意三个一致
3、方法名与sql一一对应,并且建议方法名与sql id 保持一致
4、检查一下applicationContext.xml 的这些位置路径是否有误
有问题随时留言哦!
有用点个关注。手留余香!???? ???? ????
上一篇: 坑! Spring报错Class not found: “XXXTest“找不到测试类 找不到applicationContext.xml
下一篇: java.sql.SQLException: Access denied for user 'app '@'xxx.xxx.xxx.xxx' (using password: YES)
推荐阅读
-
SpringBoot整合mybatis访问时报错Invalid bound statement (not found)
-
引入mybatis-plus报 Invalid bound statement错误问题的解决方法
-
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
-
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found
-
Mybatis之Invalid bound statement
-
Mybatis之Invalid bound statement
-
Invalid bound statement (not found)问题解决方案
-
@org.apache.ibatis.annotations.Mapper 中的 Mapper 异常 Invalid bound statement (not found)
-
mybatis+atomikos出现invalid bound statement (not found)
-
SpringBoot整合mybatis访问时报错Invalid bound statement (not found)