启动SpringCloud项目报错Attribute ‘proxyBeanMethods’ in annotation
错误信息:
org.springframework.core.annotation.AnnotationConfigurationException: Attribute 'proxyBeanMethods' in annotation [org.springframework.boot.autoconfigure.SpringBootApplication] is declared as an @AliasFor nonexistent attribute 'proxyBeanMethods' in annotation [org.springframework.context.annotation.Configuration].
at org.springframework.core.annotation.AnnotationTypeMapping.resolveAliasTarget(AnnotationTypeMapping.java:160) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMapping.resolveAliasTarget(AnnotationTypeMapping.java:131) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMapping.resolveAliasedForTargets(AnnotationTypeMapping.java:123) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMapping.<init>(AnnotationTypeMapping.java:100) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMappings.addIfPossible(AnnotationTypeMappings.java:116) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMappings.addAllMappings(AnnotationTypeMappings.java:75) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:68) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:46) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMappings$Cache.createMappings(AnnotationTypeMappings.java:251) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:324) ~[na:1.8.0_241]
at org.springframework.core.annotation.AnnotationTypeMappings$Cache.get(AnnotationTypeMappings.java:247) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:204) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:186) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:173) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.TypeMappedAnnotations$IsPresent.doWithAnnotations(TypeMappedAnnotations.java:330) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.TypeMappedAnnotations$IsPresent.doWithAnnotations(TypeMappedAnnotations.java:279) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:216) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:198) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationsScanner.processClass(AnnotationsScanner.java:128) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationsScanner.process(AnnotationsScanner.java:107) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:97) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:78) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.TypeMappedAnnotations.scan(TypeMappedAnnotations.java:242) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.core.annotation.TypeMappedAnnotations.isPresent(TypeMappedAnnotations.java:98) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.boot.BeanDefinitionLoader.isComponent(BeanDefinitionLoader.java:279) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:156) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:136) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:128) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.load(SpringApplication.java:691) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:392) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at com.neusoft.ProviderApp.main(ProviderApp.java:9) [classes/:na]
解决方法一:
升高spring boot的版本
原来版本:
<spring-boot.version>2.1.14.RELEASE</spring-boot.version>
改为:
<spring-boot.version>2.2.3.RELEASE</spring-boot.version>
解决方法二:
在spring boot中添加type 和scope
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
对impot的理解,可参考下面链接的讲解:
https://blog.csdn.net/shijiujiu33/article/details/93381277