2019-09-10 15:39:23.937 ERROR 5844 --- [           main] o.s.boot.SpringApplication               : Application run failed

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:163) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMapping.resolveAliasTarget(AnnotationTypeMapping.java:134) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMapping.resolveAliasedForTargets(AnnotationTypeMapping.java:126) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMapping.<init>(AnnotationTypeMapping.java:103) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.addIfPossible(AnnotationTypeMappings.java:109) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.addAllMappings(AnnotationTypeMappings.java:68) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:61) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:46) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings$Cache.createMappings(AnnotationTypeMappings.java:217) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) ~[na:na]
    at org.springframework.core.annotation.AnnotationTypeMappings$Cache.get(AnnotationTypeMappings.java:213) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:181) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:168) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotations$IsPresent.doWithAnnotations(TypeMappedAnnotations.java:330) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotations$IsPresent.doWithAnnotations(TypeMappedAnnotations.java:279) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:211) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:194) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.processClass(AnnotationsScanner.java:128) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.process(AnnotationsScanner.java:107) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:97) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:78) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotations.scan(TypeMappedAnnotations.java:242) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotations.isPresent(TypeMappedAnnotations.java:98) ~[spring-core-5.2.0.RC2.jar:5.1.2.RELEASE]
    at org.springframework.boot.BeanDefinitionLoader.isComponent(BeanDefinitionLoader.java:279) ~[classes/:na]
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:156) ~[classes/:na]
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:136) ~[classes/:na]
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:128) ~[classes/:na]
    at org.springframework.boot.SpringApplication.load(SpringApplication.java:691) ~[classes/:na]
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:392) ~[classes/:na]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[classes/:na]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[classes/:na]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[classes/:na]
    at com.xkcoding.helloworld.SpringBootDemoHelloworldApplication.main(SpringBootDemoHelloworldApplication.java:28) ~[classes/:na]


Process finished with exit code 1

Comment From: snicoll

@13567436138 this looks like a good candidate for a corrupted jar to me. If you're using maven, please run mvn dependency:purge-local-repository and try to download the bits again. If that doesn't work, we'll need a sample we can run ourselves that reproduces the issue

Comment From: wilkinsona

Either that or you have mismatched Spring Framework jar files on the class path. proxyBeanMethods is new in 5.2 and I can see 5.1.2.RELEASE in some elements of the stack.

Comment From: 13567436138

vn dependency:purge-local-repository not solve the problem

Comment From: snicoll

As suggested by Andy, can you please make sure you don't have mixed jars on the classpath? mvn dependency:list -Dsort should show Spring Framework 5.2 (and not 5.1).

Comment From: 13567436138

yes,you are right,thanks

Comment From: wilkinsona

Thanks for letting us know.

Comment From: Shiv-Kumar-Yadav9

I am facing same issue. I changed my spring-boot dependency from 2.0.4.RELEASE to 2.2.5.RELEASE . Error faced is :

[ERROR] 2020-04-22 18:11:57.052 [main] [] SpringApplication - Application run failed
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.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMapping.resolveAliasTarget(AnnotationTypeMapping.java:131) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMapping.resolveAliasedForTargets(AnnotationTypeMapping.java:123) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMapping.<init>(AnnotationTypeMapping.java:100) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.addIfPossible(AnnotationTypeMappings.java:116) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.addAllMappings(AnnotationTypeMappings.java:75) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:68) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:46) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings$Cache.createMappings(AnnotationTypeMappings.java:251) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:324) ~[?:1.8.0_181]
    at org.springframework.core.annotation.AnnotationTypeMappings$Cache.get(AnnotationTypeMappings.java:247) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:204) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:186) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:173) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotations$IsPresent.doWithAnnotations(TypeMappedAnnotations.java:330) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotations$IsPresent.doWithAnnotations(TypeMappedAnnotations.java:279) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:216) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:198) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.processClass(AnnotationsScanner.java:128) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.process(AnnotationsScanner.java:107) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:97) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:78) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotations.scan(TypeMappedAnnotations.java:242) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.core.annotation.TypeMappedAnnotations.isPresent(TypeMappedAnnotations.java:98) ~[spring-core-5.2.5.RELEASE.jar:5.2.5.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.xyz.eventprocessorengine.EventProcessorEngineApplication.main(EventProcessorEngineApplication.java:10) [classes/:?]

I checked my dependency tree and its only using Spring-Boot 2.2.5.RELEASE and Spring- Core uses 5.2.5.RELEASE version everywhere.

Comment From: Shiv-Kumar-Yadav9

Thanks for letting us know.

Hi Andy do you think there could be some other cause for this issue. Thanks.

Comment From: wilkinsona

No, I don't think so. Note that org.springframework.context.annotation.Configuration is part of spring-context so you should check the version of that module as well.

Comment From: Shiv-Kumar-Yadav9

Voila, I had missed that. Thanks Andy.

Comment From: kiranv1283

I have faced the same issue but it solved by updating the below entry under main class. old: public static void main(String... args) { new: public static void main(String[] args) {

Comment From: rfogel

Hello. I'm experience the same issue. Here's my dependecies:

org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-actuator:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-autoconfigure:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-devtools:jar:2.3.3.RELEASE:compile (optional)
org.springframework.boot:spring-boot-starter-actuator:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-starter-aop:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-starter-json:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-starter-logging:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-starter-test:jar:2.3.3.RELEASE:test
org.springframework.boot:spring-boot-starter-tomcat:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-starter-validation:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-starter-web:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-starter:jar:2.3.3.RELEASE:compile
org.springframework.boot:spring-boot-test-autoconfigure:jar:2.3.3.RELEASE:test
org.springframework.boot:spring-boot-test:jar:2.3.3.RELEASE:test
org.springframework.boot:spring-boot:jar:2.3.3.RELEASE:compile
org.springframework.cloud:spring-cloud-commons:jar:2.2.5.RELEASE:compile
org.springframework.cloud:spring-cloud-config-client:jar:2.2.5.RELEASE:compile
org.springframework.cloud:spring-cloud-context:jar:2.2.5.RELEASE:compile
org.springframework.cloud:spring-cloud-function-context:jar:3.0.10.RELEASE:compile
org.springframework.cloud:spring-cloud-function-core:jar:3.0.10.RELEASE:compile
org.springframework.cloud:spring-cloud-schema-registry-client:jar:1.0.8.RELEASE:compile
org.springframework.cloud:spring-cloud-starter-config:jar:2.2.2.RELEASE:compile
org.springframework.cloud:spring-cloud-starter:jar:2.2.5.RELEASE:compile
org.springframework.cloud:spring-cloud-stream-binder-kafka-core:jar:3.0.10.RELEASE:compile
org.springframework.cloud:spring-cloud-stream-binder-kafka-streams:jar:3.0.11.BUILD-SNAPSHOT:compile
org.springframework.cloud:spring-cloud-stream-binder-kafka:jar:3.0.11.BUILD-SNAPSHOT:compile
org.springframework.cloud:spring-cloud-stream:jar:3.0.8.RELEASE:compile
org.springframework.data:spring-data-commons:jar:2.3.3.RELEASE:compile
org.springframework.data:spring-data-keyvalue:jar:2.3.3.RELEASE:compile
org.springframework.integration:spring-integration-core:jar:5.3.2.RELEASE:compile
org.springframework.integration:spring-integration-jmx:jar:5.3.2.RELEASE:compile
org.springframework.integration:spring-integration-kafka:jar:3.3.1.RELEASE:compile
org.springframework.kafka:spring-kafka-test:jar:2.6.3:test
org.springframework.kafka:spring-kafka:jar:2.5.5.RELEASE:compile
org.springframework.retry:spring-retry:jar:1.2.5.RELEASE:compile
org.springframework.security.kerberos:spring-security-kerberos-core:jar:1.0.1.RELEASE:compile
org.springframework.security:spring-security-core:jar:5.3.4.RELEASE:compile
org.springframework.security:spring-security-crypto:jar:5.3.4.RELEASE:compile
org.springframework.security:spring-security-rsa:jar:1.0.9.RELEASE:compile
org.springframework:spring-aop:jar:5.2.8.RELEASE:compile
org.springframework:spring-beans:jar:5.2.8.RELEASE:compile
org.springframework:spring-context:jar:5.2.8.RELEASE:compile
org.springframework:spring-core:jar:5.2.8.RELEASE:compile
org.springframework:spring-expression:jar:5.2.8.RELEASE:compile
org.springframework:spring-jcl:jar:5.2.8.RELEASE:compile
org.springframework:spring-messaging:jar:5.2.8.RELEASE:compile
org.springframework:spring-test:jar:5.2.8.RELEASE:test
org.springframework:spring-tx:jar:5.2.8.RELEASE:compile
org.springframework:spring-web:jar:5.2.8.RELEASE:compile
org.springframework:spring-webmvc:jar:5.2.8.RELEASE:compile

When I add the following dependency, the project starts to crash:

<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>

Ps: I already a mvn dependency:purge-local-repository but no success.

Thanks in advanced!

Comment From: wilkinsona

@rfogel I can't see why adding spring-kafka-test would cause a problem. For the proxyBeanMethods attribute to be missing you must have an old spring-context jar on the classpath although I can't spot it in the output above. If you'd like some help figuring out what's wrong with your classpath, please ask a question on Stack Overflow and include a minimal, reproducible example with your question.

Comment From: rfogel

@wilkinsona sorry for the delay. I think intelij did a mess with my classpath. Anyway, it's solved. Thanks for the help.

Comment From: lloyd31

To add to the list of symptoms. I was able to notice the issue with the usage of the maven assembly plugin. Getting rid of the same helped me launch the app without any issues.

Below was the assembly plugin usage.

<build>
    <finalName>SharedLibComponents</finalName>
    <plugins>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <appendAssemblyId>false</appendAssemblyId>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id> 
                    <phase>package</phase> 
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Comment From: gouravkrosx

I am getting the same error. SpringBoot version: 2.2.0.RELEASE Spring version: 5.1.1.RELEASE <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.0.0</version> <executions> <execution> <id>shade-my-jar</id> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <manifestEntries> <Main-Class>com.javatechie.es.api.SpringBootElasticserachExampleApplication</Main-Class> </manifestEntries> </transformer> </transformers> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> </configuration> </execution> </executions> </plugin> I am using the above plugin in my pom.xml and I can't remove this as it is required.

Comment From: wilkinsona

@gouravkrosx OSS support for Spring Boot 2.2.0.RELEASE ended almost 2 years ago. It also requires Spring Framework 5.2. You should upgrade to Spring Boot 2.6.x or 2.7.x as soon as you can.

Comment From: gouravkrosx

@gouravkrosx OSS support for Spring Boot 2.2.0.RELEASE ended almost 2 years ago. It also requires Spring Framework 5.2. You should upgrade to Spring Boot 2.6.x or 2.7.x as soon as you can.

Sure, thanks