项目加入FeignClient后再启动就报错,具体报错信息如下:

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:2118) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.from(AnnotationUtils.java:2057) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.core.annotation.AnnotationUtils.getAttributeAliasNames(AnnotationUtils.java:1726) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.core.annotation.AnnotationUtils.getAttributeAliasMap(AnnotationUtils.java:1639) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.core.annotation.AnnotationUtils.postProcessAnnotationAttributes(AnnotationUtils.java:1256) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.core.annotation.AnnotationUtils.postProcessAnnotationAttributes(AnnotationUtils.java:1217) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.core.type.classreading.AnnotationReadingVisitorUtils.convertClassValues(AnnotationReadingVisitorUtils.java:52) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.getAnnotationAttributes(AnnotationMetadataReadingVisitor.java:134) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.getAnnotationAttributes(AnnotationMetadataReadingVisitor.java:127) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.getAnnotationAttributes(AnnotationMetadataReadingVisitor.java:49) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.cloud.netflix.feign.FeignClientsRegistrar.registerFeignClients(FeignClientsRegistrar.java:155) ~[spring-cloud-netflix-core-1.1.0.RELEASE.jar:1.1.0.RELEASE]
at org.springframework.cloud.netflix.feign.FeignClientsRegistrar.registerBeanDefinitions(FeignClientsRegistrar.java:87) ~[spring-cloud-netflix-core-1.1.0.RELEASE.jar:1.1.0.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:359) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:143) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at clc.movie.MovieServiceApplication.main(MovieServiceApplication.java:44) [classes/:na]

检查了各种配置均没有发现问题,怀疑是版本不匹配的问题

我用的springboot 是1.5.6,springcloud是Brixton.RELEASE

这两个版本不兼容,导致了上面的错误

解决办法

是把Brixton.RELEASE 版本替换成 Dalston.SR5

spring boot 跟 spring cloud的版本对应关系如下

spring boot spring cloud
Spring Boot 1.2.x Angel
Spring Boot 1.3.x Brixton
Spring Boot 1.4.x Camden
Spring Boot 1.5.x Dalston和Edgware
Spring Boot 2.0.x Finchley

spring cloud 启动报错-must be declared as an @AliasFor [serviceId], not [name].的更多相关文章

  1. spring cloud 启动报错问题 Input length = 1

    Caused by: org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input l ...

  2. Spring boot 启动报错 Failed to auto-configure a DataSource

    1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...

  3. spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

    spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...

  4. 解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level

    解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level 学习了:https://blog.csdn. ...

  5. 【原创】大叔经验分享(67)spring boot启动报错

    spring boot 启动报错: Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback Logg ...

  6. spring boot 启动报错(spring-boot-devtools热部署后):The elements [spring.resources.cache-period] were left unbound. Update your application's configuration

    详细错误代码: *************************** APPLICATION FAILED TO START *************************** Descript ...

  7. 新建Spring boot 启动报错 Failed to auto-configure a DataSource

    今天学习springboot,使用idea创建项目.在选择组件时添加了mysq 然后在第一次启动的时候启动报错,错误信息如下: ***************************APPLICATI ...

  8. Spring Cloud Gateway报错:Unable to start embedded Tomcat

    最近搭建Spring Cloud Gateway时启动项目出现如下报错信息: Error starting ApplicationContext. To display the conditions ...

  9. Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37

    使用命令 java -jar springBoot.jar  启动项目,结果报错如下: Exception at java.lang.String.substring(String.java:) at ...

随机推荐

  1. 洛谷P3143 [USACO16OPEN]钻石收藏家Diamond Collector

    题目描述 Bessie the cow, always a fan of shiny objects, has taken up a hobby of mining diamonds in her s ...

  2. Xcode打包应用为ipa

    Xcode教程 Xcode4发布测试 打包Archive操作是本文要介绍的内容,发布测试的最后一步打包(Archive),Xcode4帮助文档有比较详细介绍,但是居然是错的,这里说明一下. 1.设置& ...

  3. laravel 查询构造器2

    //查询构造器 public function query() { //获取所有的数据 $student = DB::table('student')->get(); var_dump($stu ...

  4. poj 3461 hash解法

    字符串hash https://blog.csdn.net/pengwill97/article/details/80879387 https://blog.csdn.net/chaiwenjun00 ...

  5. T1553 互斥的数 codevs

    http://codevs.cn/problem/1553/ 题目描述 Description 有这样的一个集合,集合中的元素个数由给定的N决定,集合的元素为N个不同的正整数,一旦集合中的两个数x,y ...

  6. 深入浅出:Linux设备驱动之字符设备驱动

    一.linux系统将设备分为3类:字符设备.块设备.网络设备.使用驱动程序: 字符设备:是指只能一个字节一个字节读写的设备,不能随机读取设备内存中的某一数据,读取数据需要按照先后数据.字符设备是面向流 ...

  7. C++字符串转数字,数字转字符串

    1. 字符串转数字 如将"32"转为32,将"3.1415"转为3.1415,将"567283"转为567283.使用: //Convert ...

  8. [WASM] Access WebAssembly Memory Directly from JavaScript

    While JavaScript has a garbage-collected heap, WebAssembly has a linear memory space. Nevertheless u ...

  9. innodb 修改表共享空间为独立空间

    最近在优化mysql innodb存储引擎,准备把共享表空间转换成独立表空间.刚开始的没考虑这么多,过段时间又要推广,所以优化一下,看看效果如何.说一个转换过程. 1,查看一下是共享表空间,还是独立表 ...

  10. android 4.4以上能够实现的沉浸式状态栏效果

    仅仅有android4.4以及以上的版本号才支持状态栏沉浸效果 先把程序执行在4.4下面的手机上,看下效果: 在4.4以上的效果: watermark/2/text/aHR0cDovL2Jsb2cuY ...