mybatis报错Type interface xxx.Dao is not known to the MapperRegistry
生活随笔
收集整理的這篇文章主要介紹了
mybatis报错Type interface xxx.Dao is not known to the MapperRegistry
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
??? 今天在做mybatis的時候,遇到一個錯誤,大家看看這個錯誤吧:org.apache.ibatis.binding.BindingException: Type interface cn.mybatis_chop10_1.dao.IEmpDao is not known to the MapperRegistry.
?????????? 我前找找后找找,就是找不出來,上網(wǎng)也沒有找到具體的解決方式,于是,我就開始從mybatis-config.xml? 到dao,再到Mapper.xm里面一句一句的看,直到我看到:
?
<mapper namespace="cn.mybatis_chop10_1.dao.EmpMapper">
這一行的時候,瞬間恍然大悟,原來是后面的EmpMapper寫錯了,把它改掉就行,比如我的是:
?
?
<mapper namespace="cn.mybatis_chop10_1.dao.IEmpDao">
???? 在此告訴下大家,一定要細心,細心,再細心!!!尤其是重命名或者Ctrl+C,Ctrl+V的時候,格外注意!!!
?
?????? 最后在推薦一篇:mybatis反向生成實體類,dao層,Mapper:點擊這里
?
總結(jié)
以上是生活随笔為你收集整理的mybatis报错Type interface xxx.Dao is not known to the MapperRegistry的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何在Windows下实现全局代理任何软
- 下一篇: hibernate+struts2整合j