No fallbackFactory instance of type class com.ruoyi.system.api.factory.RemoteLogFallbackFactory foun

报错找不到这个类(托底类)

/**
 * 日志服务降级处理
 * 
 * @author ruoyi
 */
@Component
public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteLogFallbackFactory.class);

    @Override
    public RemoteLogService create(Throwable throwable)
    {
        log.error("日志服务调用失败:{}", throwable.getMessage());
        return new RemoteLogService()
        {
            @Override
            public R<Boolean> saveLog(SysOperLog sysOperLog)
            {
                return null;
            }

            @Override
            public R<Boolean> saveLogininfor(String username, String status, String message)
            {
                return null;
            }
        };

    }
}

微服务之间是通过Fegin进行调用,创建了API接口,供其他模块调用,如果API接口开启了熔断机制,分类服务就无法进行启动,显示找不到托底函数。需要在分类服务启动类上指定包名,
@SpringBootApplication(scanBasePackages = “com.ruoyi”)

@EnableRyFeignClients
@SpringBootApplication(scanBasePackages = "com.ruoyi")
public class RuoYiAuthApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(RuoYiAuthApplication.class, args);
    }
}
上一篇:龙骨动画学习二:在egret项目中播放一个龙骨动画


下一篇:PHP高级特性-反射Reflection以及Factory工厂设计模式的结合使用[代码实例]