When using the annotation @EnableAsync with Mode = AdviceMode.ASPECTJ, the following exception occurs with Spring Boot version 3.2.6:
Caused by: java.lang.IllegalStateException: Expecting to find 3 arguments to bind by name in advice, but actually found 1 arguments.
at org.springframework.aop.aspectj.AbstractAspectJAdvice.bindExplicitArguments(AbstractAspectJAdvice.java:472)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.bindArgumentsByName(AbstractAspectJAdvice.java:438)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.calculateArgumentBindings(AbstractAspectJAdvice.java:389)
at org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.getAdvice(ReflectiveAspectJAdvisorFactory.java:306)
at org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl.instantiateAdvice(InstantiationModelAwarePointcutAdvisorImpl.java:152)
at org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl.<init>(InstantiationModelAwarePointcutAdvisorImpl.java:116)
at org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.getAdvisor(ReflectiveAspectJAdvisorFactory.java:216)
at org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.getAdvisors(ReflectiveAspectJAdvisorFactory.java:146)
at org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder.buildAspectJAdvisors(BeanFactoryAspectJAdvisorsBuilder.java:110)
at org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator.findCandidateAdvisors(AnnotationAwareAspectJAutoProxyCreator.java:95)
at org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.shouldSkip(AspectJAwareAdvisorAutoProxyCreator.java:101)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessBeforeInstantiation(AbstractAutoProxyCreator.java:281)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1130)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1105)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:511)
... 36 more
If Spring Boot version 3.2.5 is used, this error does not occur. I have attached a minimal example project that demonstrates this error. Simply start the application or the test.
Comment From: wilkinsona
Thanks for the sample, @clude86. This appears to be a regression in Spring Framework 6.1.7 and 6.1.8 as the problem does not occur when Spring Framework is downgraded to 6.1.6. We'll transfer this to the Framework team so that they can take a look.
Comment From: bclozel
I suspect this is a duplicate of #32882 - can you try using Spring Framework 6.1.9-SNAPSHOT and report back?
You can do so by setting the following in your maven build:
<properties>
<spring-framework.version>6.1.9-SNAPSHOT</spring-framework.version>
</properties>
or in Gradle:
ext['spring-framework.version] = "6.1.9-SNAPSHOT"
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/snapshot' }
}
Comment From: snicoll
Thanks for the report, @clude86. This is indeed a duplicate of #32882. I've given your sample a try with 6.1.9-SNAPSHOT
and that fixed the issue. I am going to close this but please test the snapshot against your application and let us know if you still experience the problem.
Comment From: clude86
Many thanks for the quick feedback. By using the Spring Framework 6.1.9-SNAPSHOT i can start my application without any problems. Version 6.1.9-SNAPSHOT therefore fixes the problem.
Comment From: whcrow
I suspect this is a duplicate of #32882 - can you try using Spring Framework 6.1.9-SNAPSHOT and report back?
You can do so by setting the following in your maven build:
<properties> <spring-framework.version>6.1.9-SNAPSHOT</spring-framework.version> </properties>
or in Gradle:
```groovy ext['spring-framework.version] = "6.1.9-SNAPSHOT"
repositories { mavenCentral() maven { url 'https://repo.spring.io/snapshot' } } ```
6.1.9-SNAPSHOT is work, Thanks!