org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 解决方法,
分享于 点击 2831 次 点评:259
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 解决方法,
造成的原因:
1.xml中的名字与mapper中的名字未对应,导致报错。
解决方法:修改名字相对应即可。
2.Maven加载时只会对.java文件进行编译,不会对其他类型的文件进行编译
解决方法:①将xml文件夹复制到到target中的Mapper下
(不推荐)
②将xml移动到resources中去
(不推荐)
③配置pom.xml和application.properties
(1)pom.xml中加入下面代码
<build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources> </build>
(2)application.properties中加入下面代码
mybatis-plus.mapper-locations=classpath:com/llc/eduservice/mapper/xml/*.xml //根据自己的项目更改路径
相关文章
- 暂无相关文章
用户点评