依存关系


org.springframework.cloud:spring-cloud-starter-feign:jar:1.2.2.RELEASE:compilecom.netflix.feign:feign-core:jar:8.16.2:compilecom.netflix.feign:feign-slf4j:jar:8.16.2:compilecom.netflix.feign:feign-jackson:jar:8.15.1:compile


  在SpringBootAppilication上启用伪装


@EnableFeignClients(basePackages = "com.vett.services.bucket.restclient")


  虚拟界面客户端


@FeignClient(name = "myClient", configuration = ClientConfigs.class, url = "https://my-endpoint");public interface MyClient {


  导致此错误


org.springframework.core.annotation.AnnotationConfigurationException: Attribute 'value' in annotation [org.springframework.cloud.netflix.feign.FeignClient] must be declared as an @AliasFor [serviceId], not [name]


  到目前为止,我有


我不清楚问题是什么,我使用了value而不是name,我的搜索没有成功,我看到了一些假装注释问题,但看起来根本没有类似之处

最佳答案

我遇到了同样的问题,添加以下依赖项后,它开始起作用:

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:Brixton.SR7"}
}


我正在使用Spring Boot 1.4但使用Spring 4.3.6。还春季装扮1.2.5.RELEASE

关于java - Netflix Feign异常(exception),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42033109/

10-11 05:19