IDEA中配置mybstis显示org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

初次使用IDEA配置mybatis发现报错
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

网上找了很多解决方法都没效,确认了mapper的配置是没有问题的

然后无意中发现eclipse、myeclipse、idea针对项目的文件处理方式不一样,如果mapper xml文件放在src下会无法识别,需要在pom.xml中添加

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

猜你喜欢

转载自blog.csdn.net/weixin_38381245/article/details/83896514