在搭建自己的后台管理,遇到一个比较小问题,顺便记录了一下。

启动SpringBoot后台时,前端访问后台执行Mybatis时,出现了这样的报错:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zhu.fte.dao.SysUserMapper.selectByExample

SpringBoot+Mybatis整合出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)的解决

经检查,发现原来springboot整合mybatis, 需要在pom.xml里增加以下信息:

  1 <build>
  2 <resources>
  3     <resource>
  4         <directory>src/main/java</directory>
  5         <includes>
  6             <include>**/*.xml</include>
  7         </includes>
  8     </resource>
  9 </resources>
 10 </build>
若遗漏话,将导致在编译时,只会生成Mapper的class文件,而没有xml文件,因此,就会报找不到selectByExample的错误信息。

相关文章:

  • 2021-11-22
  • 2021-11-15
  • 2021-12-16
  • 2021-12-14
  • 2022-12-23
  • 2021-05-01
猜你喜欢
  • 2021-12-12
  • 2022-12-23
  • 2021-04-15
  • 2021-11-01
  • 2021-11-03
  • 2021-12-09
  • 2022-12-23
相关资源
相似解决方案