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

method demarcated with @Async isn't executed when precompiled [SPR-10715] #15343

Closed
spring-issuemaster opened this issue Jul 2, 2013 · 4 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Jul 2, 2013

Lukasz Rozek opened SPR-10715 and commented

when method is annotated with @Async and class is precompiled. method isn't executed at all.


Affects: 3.2.2, 3.2.3

Attachments:

Issue Links:

  • #15264 Invocation of @Async service fails
  • #15125 Async does not work anymore when switching from 3.2 to 3.2.2
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 2, 2013

Lukasz Rozek commented

following exception is thrown when running @Async method for precompiled class. It fails for spring 3.2.3 and 3.2.2. It works with spring 3.2.1 and 3.2.0

java.lang.IllegalStateException: No executor qualifier specified and no default executor set on AnnotationAsyncExecutionAspect either
	at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.determineAsyncExecutor(AsyncExecutionAspectSupport.java:104)
	at org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect.ajc$around$org_springframework_scheduling_aspectj_AbstractAsyncExecutionAspect$1$6c004c3e(AbstractAsyncExecutionAspect.aj:60)
	at pl.lrozek.spring.async.AsyncMethod.asyncCall(AsyncMethod.java:17)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:89)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:724)

here is url for project for reproduction

git clone https://github.com/lrozek/SPR-10715.git
https://github.com/lrozek/SPR-10715

following executions will run test with different spring versions with precompiled class

mvn clean package -PwithPrecompilation -PwithSpring3.2.3  -> BUILD FAILURE
mvn clean package -PwithPrecompilation -PwithSpring3.2.2  -> BUILD FAILURE
mvn clean package -PwithPrecompilation -PwithSpring3.2.1  -> BUILD SUCCESS
mvn clean package -PwithPrecompilation -PwithSpring3.2.0  -> BUILD SUCCESS

following executions will run test with different spring versions without precompiled class

mvn clean package -PwithSpring3.2.3  -> BUILD SUCCESS
mvn clean package -PwithSpring3.2.2  -> BUILD SUCCESS
mvn clean package -PwithSpring3.2.1  -> BUILD SUCCESS
mvn clean package -PwithSpring3.2.0  -> BUILD SUCCESS
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 2, 2013

Lukasz Rozek commented

I think here is related issue https://jira.springsource.org/browse/SPR-10492, as two top stack frames are the same

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 2, 2013

Phil Webb commented

Possibly also #15264

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 24, 2013

Juergen Hoeller commented

I've moved that executor null check to our proxy-based AsyncExecutionInterceptor now where we do want a strict check, allowing the AspectJ AbstractAsyncExecutionAspect to fall back to sync execution (as in 3.2.1).

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.