我有一个Spring Boot(版本2.2.6.RELEASE)Web项目。
从此Web应用程序(我称为“ APP1”),我想使用另一个Web应用程序中的PATCH方法调用另一个URI(我们将其称为“ APP2”)。在我的pom.xml中,我具有以下依赖性:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
这是我如何调用另一个Web应用程序的PATCH方法。
@FeignClient(name = "clientName", url = "base-uri")
public interface MyInterface{
@PatchMapping(value = "/target-uri")
void callClientMethod(Map<String, Object> args);
我在互联网上寻找解决方案,并将以下代码段添加到我的pom.xml中
<dependency>
<groupId>com.netflix.feign</groupId> <!-- Also tried io.github.openfeign -->
<artifactId>feign-httpclient</artifactId>
<version>8.18.0</version>
</dependency>
[之后,仍然正确调用APP2的PATCH方法,但是在APP1中,出现以下错误:java.lang.NoSuchMethodError:feign.Response.create(ILjava / lang / String; Ljava / util / Map; Lfeign / Response $ Body;)Lfeign / Response;
感谢您的帮助!
遇到同样的问题。如果有人有任何想法请帮助。