错误信息
org.apache.ibatis.binding.BindingException: Type interface com.chun.dao.UserMapper is not known to the MapperRegistry.
出现问题
当你在优快云上查完所有解决方案后,还是有问题
UserMapper与UserMapper.xml已经绑定
注意地址是xxx.xxx.xxx,而不是xxx/xxx/xxx
<mapper namespace="com.chun.dao.UserMapper">
mybatis-config.xml也已经与UserMapper.xml绑定
而resource是"xxx/xxx/xxx"
<mappers>
<mapper resource="com/chun/dao/UserMapper.xml"/>
</mappers>
最终解决
删掉IDEA中橙色的target
因为可能你没有重新加载你的生成的程序,也就是在IDEA中生成的target没有更新,把它删掉后重新启动

本文解决MyBatis中出现的BindingException问题,详细描述了当UserMapper未被正确识别时的解决步骤,包括检查XML配置文件路径及重置IDEA的target目录。
1663

被折叠的 条评论
为什么被折叠?



