解决 Could not autowire. No beans of‘ XXX‘ type found.i 错误的一点思路

Could not autowire. No beans of’ XXX’ type found.i

异常信息

Could not autowire. No beans of’ XXX’ type found.i

原因

解决 Could not autowire. No beans of‘ XXX‘ type found.i 错误的一点思路

出现这种问题的原因是因为 IOC 中没有该类型的对象, 大部分是因为 Spring 扫描不到类上的注解导致, 还有一部分原因是因为注解导错包, 或者使用了错误的注解导致对象没有扫描到 IOC 中