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

原因是接口**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>