Closed min1854 closed 1 year ago
Caused by: java.lang.IllegalStateException: Incompatible fallback instance. Fallback/fallbackFactory of type class com.old.common.feign.fallback.FallbackTemplate is not assignable to interface com.old.common.api.weChat.feign.test.TestFeign for feign client com.old.common.api.weChat.feign.test.TestFeign at org.springframework.cloud.openfeign.FeignCircuitBreakerTargeter.getFromContext(FeignCircuitBreakerTargeter.java:82) at org.springframework.cloud.openfeign.FeignCircuitBreakerTargeter.targetWithFallback(FeignCircuitBreakerTargeter.java:68) at org.springframework.cloud.openfeign.FeignCircuitBreakerTargeter.target(FeignCircuitBreakerTargeter.java:50) at org.springframework.cloud.openfeign.FeignClientFactoryBean.getTarget(FeignClientFactoryBean.java:470) at org.springframework.cloud.openfeign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:421) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:148) ... 87 more
fallback is FactoryBean IllegalStateException
As the Javadoc of the FactoryBean
says NB: A bean that implements this interface cannot be used as a normal bean.
, and as documented in @FeignClient
Javadoc for the fallback
argument, he fallback class must implement the interface annotated by this annotation and be a valid spring bean.
. This is not a scenario that we support. What is your use case and why do you intend to use a FactoryBean
for fallback?
As the Javadoc of the says , and as documented in Javadoc for the argument, . This is not a scenario that we support. What is your use case and why do you intend to use a for fallback?
FactoryBean``NB: A bean that implements this interface cannot be used as a normal bean.``@FeignClient``fallback``he fallback class must implement the interface annotated by this annotation and be a valid spring bean.``FactoryBean
I want to create one fallbackTemplate, And the instance returned by FactoryBean.getObject is the implementation instance of feignclien
Describe the bug spring-cloud-starter-openfeign:4.0.0
Sample org.springframework.cloud.context.named.NamedContextFactory#getInstance(java.lang.String, java.lang.Class)