mybatis 拋出 Mapped Statements collection does not contain value for 異常

對mybatis不是很熟,最近寫接口的時候,一直報Mapped Statements collection does not contain value for異常,最後發現是接口調用的xml裏沒有所寫方法,方法寫到了弄一個備份文件裏面了。


錯誤原因有幾種:

1、mapper.xml中沒有加入namespace
2、mapper.xml中的方法和接口mapper的方法不對應
3、mapper.xml沒有加入到mybatis-config.xml中(即總的配置文件),例外:配置了mapper文件的包路徑的除外

4、mapper.xml文件名和所寫的mapper名稱不相同。


see:http://blog.csdn.net/wang623145708/article/details/27213685

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章