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

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

启动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)的解决_第1张图片

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

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

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