springboot项目访问时找不到对应ibatis方法(Bin
2018-05-24 本文已影响0人
面朝大海_1234
springboot项目启动成功后,访问相关接口,报错
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
.........................
搜索相关资料,都说是XML和对应dao没有对应上,找不到XML中的方法导致,仔细检查后发现都是对的,
![](https://img.haomeiwen.com/i9356481/a6d45ab42f56745c.png)
![](https://img.haomeiwen.com/i9356481/43aa509edbebf7d0.png)
然后查看了下编译后的输出路径中的文件,发现根本没有XML文件
![](https://img.haomeiwen.com/i9356481/20b24ecd5849c0e5.png)
在pom.xml中加入下面代码即可
<build>
......
<resources>
<!--编译之后包含xml-->
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
......
再次编译,mapper文件夹出现
![](https://img.haomeiwen.com/i9356481/76041ff5bfd2a640.png)
此时启动项目,访问接口地址,一切OK
![](https://img.haomeiwen.com/i9356481/107ed230ffd5563c.png)