mybatis报错Type interface xxx.Dao is not...
? 今天在做mybatis的時候,遇到一個錯誤,大家看看這個錯誤吧:org.apache.ibatis.binding.BindingException: Type interface cn.mybatis_chop10_1.dao.IEmpDao is not known to the MapperRegistry.
?????????? 我前找找后找找,就是找不出來,上網也沒有找到具體的解決方式,于是,我就開始從mybatis-config.xml? 到dao,再到Mapper.xm里面一句一句的看,直到我看到:
[html]?view plain?copy?print?
<mapper?namespace="cn.mybatis_chop10_1.dao.EmpMapper">??
這一行的時候,瞬間恍然大悟,原來是后面的EmpMapper寫錯了,把它改掉就行,比如我的是:
[html]?view plain?copy?print?
<mapper?namespace="cn.mybatis_chop10_1.dao.IEmpDao">??
???? 在此告訴下大家,一定要細心,細心,再細心!!!尤其是重命名或者Ctrl+C,Ctrl+V的時候,格外注意!!!
?????? 最后在推薦一篇:mybatis反向生成實體類,dao層,Mapper:點擊這里
總結
以上是生活随笔為你收集整理的mybatis报错Type interface xxx.Dao is not...的全部內容,希望文章能夠幫你解決所遇到的問題。