1. 程式人生 > >IDEA中配置mybstis顯示org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

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>