MyBatis报错BindingException:Type interface is not known to the MapperRegistry.

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_36798272/article/details/89838687

在这里插入图片描述
出现这个错误是自己粗心大意所导致的.这个异常叫绑定异常,大概的意思是找不到IUserDao这个接口对应mapper的xml文件,了解了这个就好办了.

1. 确定自己已经编写了IUserDao接口对应的mapper文件,我的文件名为IUserDao.xml
2. 确定在sqlMapConfig.xml中有没有加载IUserDao.xml
3. 如果加载了,查看IUserDao.xml中namespace是否写完整,填写对应接口的路径

在这里插入图片描述
问题解决~

猜你喜欢

转载自blog.csdn.net/qq_36798272/article/details/89838687