spring boot在intellij idea下整合mybatis可能遇到的问题

org.apache.ibatis.builder.BuilderException: Wrong namespace. Expected 'com.sc.starry_sky.dao.UserMapper' but found 'UserMapper'.

这个错误是没找到对应的mapper接口,检查namespace写对了没

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

出现这个错误的原因xml文件没有被编译,在pom文件里build标签下面加入如下即可解决

<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
上一篇:Python爬虫:常用浏览器的useragent


下一篇:Macaca自动化测试之PC端测试