Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Boot 3.2.6 with async mode AdviceMode.ASPECTJ IllegalStateException #32916

Closed
clude86 opened this issue May 28, 2024 · 5 comments
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue

Comments

@clude86
Copy link

clude86 commented May 28, 2024

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.

aspectj_error.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 28, 2024
@wilkinsona
Copy link
Member

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.

@bclozel bclozel transferred this issue from spring-projects/spring-boot May 28, 2024
@snicoll snicoll self-assigned this May 28, 2024
@bclozel
Copy link
Member

bclozel commented May 28, 2024

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' }
}

@snicoll
Copy link
Member

snicoll commented May 28, 2024

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.

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
@snicoll snicoll added status: duplicate A duplicate of another issue in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 28, 2024
@clude86
Copy link
Author

clude86 commented May 28, 2024

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.

@whcrow
Copy link

whcrow commented May 31, 2024

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' }
}

6.1.9-SNAPSHOT is work,
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

6 participants