Field accountMapper in com.XXX.XXXService required a bean of type 'com.XXX.dao.AccountMapper' that could not be found.
Action:
Consider defining a bean of type 'com.XXX.dao.AccountMapper' in your configuration.
意思是说 容器找不到指定的mapper对象,需要给配置一个
产生可能原因:
1、没有在Mapper上设置注解
2、xml配置(可能不是这个Mapper对应的)有错误,这个 在日志错误开始的时候会提示
3、容器扫描没扫描到Mapper,可以在springboot启动类上加MapperScan注解
本文介绍了当Spring容器无法找到指定的Mapper对象时的常见原因及解决办法,包括检查注解设置、XML配置以及确保容器正确扫描到Mapper。
3140

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



