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?

  1. <mapper namespace="cn.mybatis_chop10_1.dao.EmpMapper">  


这一行的时候,瞬间恍然大悟,原来是后面的EmpMapper写错了,把它改掉就行,比如我的是:

[html] view plain copy print?

  1. <mapper namespace="cn.mybatis_chop10_1.dao.IEmpDao">  


     在此告诉下大家,一定要细心,细心,再细心!!!尤其是重命名或者Ctrl+C,Ctrl+V的时候,格外注意!!!

       最后在推荐一篇:mybatis反向生成实体类,dao层,Mapper:点击这里

原文地址:https://www.cnblogs.com/a1111/p/14877531.html