关于mybatis总是报错Type interface ****** is not known to the MapperRegistry解决办法

今天学习mybatis的时候,运行的时候就会出现Type interface ******* is  not known to the MapperRegistry

 

项目结构如下:

关于mybatis总是报错Type interface ****** is not known to the MapperRegistry解决办法

运行test文件中的UpdateTest后,出现如下错误:

关于mybatis总是报错Type interface ****** is not known to the MapperRegistry解决办法

我的项目报的错误最终的解决办法是:在工具类中添加一行:factory.getConfiguration().addMapper(UserMapperUpdate.class);如下图所示:

 

关于mybatis总是报错Type interface ****** is not known to the MapperRegistry解决办法

再次测试:

关于mybatis总是报错Type interface ****** is not known to the MapperRegistry解决办法

成功!

参考文献:http://www.cnblogs.com/rollenholt/archive/2012/11/07/2758008.html