Caused by: java.lang.AbstractMethodError: Receiver class feign.hystrix.HystrixDelegatingContract does not define or inherit an implementation of the resolved method abstract parseAndValidateMetadata(Ljava/lang/Class;)Ljava/util/List; of interface feign.Contract. at feign.ReflectiveFeign$ParseHandlersByName.apply(ReflectiveFeign.java:151) at feign.ReflectiveFeign.newInstance(ReflectiveFeign.java:49) at feign.hystrix.HystrixFeign$Builder.target(HystrixFeign.java:63) at feign.hystrix.HystrixFeign$Builder.target(HystrixFeign.java:111)
I am getting the above error while creating feign client with HystrixFeign.
Comment From: spencergibb
Looks like you have mismatched dependencies
Comment From: govardhanaraoganji
I don't know, what I am missing in dependencies. Using: spring-boot-starter-parent as 2.1.8.RELEASE spring-cloud-dependencies as Greenwich.SR3 feign-hystrix as 10.2.3
Comment From: spencergibb
without seeing all of your dependencies I can't answer.
Comment From: govardhanaraoganji
These dependencies, will help you?
spring-boot-starter-parent as 2.1.8.RELEASE spring-cloud-dependencies as Greenwich.SR3 feign-hystrix as 10.2.3
<!-- Spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>${spring-security-oauth2.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-hystrix</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-slf4j</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign.form</groupId>
<artifactId>feign-form</artifactId>
</dependency>
My snippet, will looks like this, MyClient client = HystrixFeign.builder() .contract(new MyClientContract(new Contract.Default())) .encoder(new JacksonEncoder(objectMapper)) .decoder(new JacksonDecoder(objectMapper)) .logger(new Slf4jLogger(MyClient.class)) .logLevel(Logger.Level.BASIC) .target(MyClient.class, URL, new MyClientFallback());
MyClientContract: public class MyClientContract implements Contract { private final Contract delegate;
/**
map key is constructed by ClassFullName + configKey. configKey is constructed by {@link
feign.Feign#configKey}
*/
public static final Map<String, MethodMetadata> METADATA_MAP = new HashMap<>();
public MyClientContract(Contract delegate) { this.delegate = delegate; }
@override public List parseAndValidateMetadata(Class<?> targetType) { List metadatas = delegate.parseAndValidateMetadata(targetType); metadatas.forEach( metadata -> METADATA_MAP.put(targetType.getName() + metadata.configKey(), metadata)); return metadatas; } }
Comment From: OlgaMaciaszek
@govardhanaraoganji Spring Cloud Greenwich is no longer supported. Can you please verify on Hoxton release train (we recommend using https://start.spring.io/ to ensure correct dependency set) and let us know if the issue persists.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
Comment From: govardhanaraoganji
Thank you for the support @spencergibb, @OlgaMaciaszek and @spring-issuemaster. I have many dependencies with our common modules so I used different approach i.e) feign-hystrix as dependency to my component so issue got resolved. Earlier It was in our common module.