SpringBoot 在整合其资源的时候经常会遇到could not autowired. No beans of ‘xxxx’ type,虽然不影响使用,但是看着比较恶心 。
如:

这是因为在Spring在自动bean的时候还没有把当前所注入的bean装配起来,但是随着项目启动,bean被装配 了,然后调用的时候就有了。
解决办法:
加入注解
@Component(value = "apiCategoryMapper")
然后提示就消失了

SpringBoot整合资源时,常出现could not autowired. No beans of ‘xxxx’ type的提示,虽不影响使用但影响观感。原因是Spring自动装配bean时,当前注入的bean未装配好,项目启动后调用时就正常了。解决办法是加入注解@Component(value = \apiCategoryMapper\)。
SpringBoot 在整合其资源的时候经常会遇到could not autowired. No beans of ‘xxxx’ type,虽然不影响使用,但是看着比较恶心 。
如:

这是因为在Spring在自动bean的时候还没有把当前所注入的bean装配起来,但是随着项目启动,bean被装配 了,然后调用的时候就有了。
解决办法:
加入注解
@Component(value = "apiCategoryMapper")
然后提示就消失了
