zoukankan      html  css  js  c++  java
  • RemoteFallbackFactory扫包:No fallbackFactory instance of type class

    调用feign接口出现 : FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: No fallbackFactory instance of type class com*********RemoteFallbackFactory found for feign client appid

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com*********Remote': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: No fallbackFactory instance of type class com*********RemoteFallbackFactory found for feign client appid
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:178)
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:101)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1645)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1184)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:257)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1325)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1291)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1101)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:584)

    ... 32 common frames omitted

    原因:

    需要在FallBackFActory中添加 

    @Component注解
    @Component
    @Slf4j
    public class AAARemoteFallbackFactory implements FallbackFactory<AAARemote> {
    @Override
    public AAARemote create(Throwable cause) {
    return new AAARemote() {
    @Override
    public BizResponse<AAAResponse> getFunction(@RequestBody AAARequest request) {
    log.error("AAARemoteFallbackFactory getAAARemote params:{} error:{}", JSON.toJSONString(request),JSON.toJSONString(cause.getMessage()));
                    return new Response(ERROR.CODE);
    }

    };
    }
    }


     

    AAA
    团队五人,专业从事软件开发,接单工作,专注于Java,.Net,PHP
  • 相关阅读:
    word2013下,公式居中,编号右对齐
    Linux系统下,anaconda3与系统python共存
    LeetCode: 496 Next Greater Element I(easy)
    LeetCode: 463 Island Perimeter(easy)
    LeetCode: 620 Not Boring Movies(easy)
    C++: 其他类型转string
    LeetCode: 412 Fizz Buzz(easy)
    LeetCode: 344 Reverse String
    LeetCode: 566 Reshape the Matrix
    LeetCode: 575 Distribute Candies(easy)
  • 原文地址:https://www.cnblogs.com/xiaohouye/p/14735161.html
Copyright © 2011-2022 走看看