FactoryBean threw exception on object creation; nested exception is java.lang.AbstractMethodError: Receiver class com.alibaba.cloud.sentinel.feign.SentinelContractHolder does not define or inherit an implementation of the resolved method abstract parseAndValidateMetadata(Ljava/lang/Class;)Ljava/util/List; of interface feign.Contract.
报错原因:
Sentinel框架SentinelContractHolder类中找不到parseAndValidatateMetadata
这个方法,是因为这个方法拼写有错误,在Sentinel和OpenFeign新版本中已经修正为parseAndValidateMetadata
所以可以尝试修改springcloudalibaba的版本进行解决
我将cloudalibaba的版本从2.1.0修改为2.2.1得到了解决
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2.2.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<version>2.2.1.RELEASE</version>
</dependency>