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

Spring JIRA | Dave Syer | 9 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    The validation of @AliasFor seems to disallow a simple use case where an attribute is deprecated and replaced by one with a different name. Example: {code} @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface FeignClient { @AliasFor("name") String value() default ""; @Deprecated @AliasFor("value") String serviceId() default ""; @AliasFor("value") String name() default ""; } {code} {{context.getBeansWithAnnotation(...)}} throws an exception if any beans have this annotation because it claims the aliases are invalid: {noformat} org.springframework.core.annotation.AnnotationConfigurationException: Attribute [value] in annotation [org.springframework.cloud.netflix.feign.FeignClient] must be declared as an @AliasFor [serviceId], not [name]. at org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.validate(AnnotationUtils.java:1991) at org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.from(AnnotationUtils.java:1937) at org.springframework.core.annotation.AnnotationUtils.getAttributeAliasNames(AnnotationUtils.java:1626) at org.springframework.core.annotation.AnnotationUtils.isSynthesizable(AnnotationUtils.java:1585) at org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotation(AnnotationUtils.java:1368) at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:685) at ... {noformat}

    Spring JIRA | 9 months ago | Dave Syer
    org.springframework.core.annotation.AnnotationConfigurationException: Attribute [value] in annotation [org.springframework.cloud.netflix.feign.FeignClient] must be declared as an @AliasFor [serviceId], not [name].
  2. 0

    The validation of @AliasFor seems to disallow a simple use case where an attribute is deprecated and replaced by one with a different name. Example: {code} @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface FeignClient { @AliasFor("name") String value() default ""; @Deprecated @AliasFor("value") String serviceId() default ""; @AliasFor("value") String name() default ""; } {code} {{context.getBeansWithAnnotation(...)}} throws an exception if any beans have this annotation because it claims the aliases are invalid: {noformat} org.springframework.core.annotation.AnnotationConfigurationException: Attribute [value] in annotation [org.springframework.cloud.netflix.feign.FeignClient] must be declared as an @AliasFor [serviceId], not [name]. at org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.validate(AnnotationUtils.java:1991) at org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.from(AnnotationUtils.java:1937) at org.springframework.core.annotation.AnnotationUtils.getAttributeAliasNames(AnnotationUtils.java:1626) at org.springframework.core.annotation.AnnotationUtils.isSynthesizable(AnnotationUtils.java:1585) at org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotation(AnnotationUtils.java:1368) at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:685) at ... {noformat}

    Spring JIRA | 9 months ago | Dave Syer
    org.springframework.core.annotation.AnnotationConfigurationException: Attribute [value] in annotation [org.springframework.cloud.netflix.feign.FeignClient] must be declared as an @AliasFor [serviceId], not [name].
  3. 0

    @FeignClient annotation is not compatible with org.springframework.core.annotation.AnnotationUtils.findAnnotation()

    GitHub | 10 months ago | tjuchniewicz
    org.springframework.core.annotation.AnnotationConfigurationException: Attribute [value] in annotation [org.springframework.cloud.netflix.feign.FeignClient] must be declared as an @AliasFor [serviceId], not [name].
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.core.annotation.AnnotationConfigurationException

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

      at org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.validate()
    2. Spring Core
      AnnotationUtils.findAnnotation
      1. org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.validate(AnnotationUtils.java:1991)
      2. org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.from(AnnotationUtils.java:1937)
      3. org.springframework.core.annotation.AnnotationUtils.getAttributeAliasNames(AnnotationUtils.java:1626)
      4. org.springframework.core.annotation.AnnotationUtils.isSynthesizable(AnnotationUtils.java:1585)
      5. org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotation(AnnotationUtils.java:1368)
      6. org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:685)
      6 frames