原因是接口**Mapper接口映射不到**Mapperxml

1.检查**Mapperxml 是否跟**Mapper接口名一致

2.配置包扫描

spring boot 整合mybatis org.apache.ibatis.binding.BindingException: Invalid bound statement(not found)

3.检查taget 目录下是否有将**Mapper.xml加载进去,如果没有,则说明编译没有将java目录下的xml文件加载经classpath目录下

解决:

将**Mapper.xml文件移到resource目录下

maven工程可以在pom文件中加入:

<build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>
</build>

 

相关文章:

  • 2021-04-26
猜你喜欢
  • 2021-12-12
  • 2021-12-09
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2021-05-14
相关资源
相似解决方案