Springboot 报找不到对应的Mapper接口或RPC接口等问题

解决方法:

   在Service引用中找到对应的Mapper引用、RPC引用:

      给org.springframework.beans.factory.annotation.Autowired注解设置一个required属性:@Autowired(required=false);

      或者如果使用的是javax.annotation.Resource注解,则增加一个@Lazy注解;

对比一下@Lazy 和 :@Autowired(required=false)的区别:

  @Lazy 用于指定该Bean是否取消初始化。

  @Autowired(required=false) 在找不到匹配Bean时也不报错。

原文地址:https://www.cnblogs.com/jiangyaxiong1990/p/9460455.html