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

Issue with @Async in version 3.1.2 linking to the task executor it is assigned to (instead of the default) [SPR-9575] #14209

Closed
spring-projects-issues opened this issue Jul 9, 2012 · 10 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 9, 2012

Ken Young opened SPR-9575 and commented

Issue with @Async in version 3.1.2 linking to the task executor it is assigned to (instead of the default)


Affects: 3.1.2

Issue Links:

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

Chris Beams commented

Thanks, Ken. Looking forward to the repro issue.

@spring-projects-issues
Copy link
Collaborator Author

Ken Young commented

Learning Git (slowly), so bear with me. Need to minimize my MVC test project.

@spring-projects-issues
Copy link
Collaborator Author

Chris Beams commented

No rush; thanks for taking the time.

@spring-projects-issues
Copy link
Collaborator Author

Ken Young commented

I have added the pull request for this project to the GitHub repo.

Thanks
Ken

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Pull request: spring-attic/spring-framework-issues#29

@spring-projects-issues
Copy link
Collaborator Author

Chris Beams commented

Hi Ken,

Take a look at spring-attic/spring-framework-issues@2a8b821#L0R36

That statement prints false when I deploy your webapp. This means that the AsyncProcess bean is never actually getting processed for handling @Async requests. This could be because of the fact that you have an interface in the mix and that the annotation is only at the concrete class level, but in any case it appears to be a configuration issue.

Take a look at and play around with this simple test case that I contributed. You'll see there that executor selection does indeed work: spring-attic/spring-framework-issues@de91e04

If you're able to fix things up so that you've actually got an async proxy and it still fails to respect the #value attribute of the @Async annotation, feel free to reopen. Try to simplify the app as much as you can in the process.

Thanks

@spring-projects-issues
Copy link
Collaborator Author

Ken Young commented

Chris,

The issue was that class that has the async method annotated as follows:

@Component("asyncProcess")
@EnableAsync(proxyTargetClass=true)
public class AsyncProcessClass{

Once this was added, the annotation worked flawlessly.

Thanks
Ken

@spring-projects-issues
Copy link
Collaborator Author

Ittai Zeidman commented

@Ken,
Can you please explain which annotation was added and was there an interface involved?

Thanks,
Ittai

@spring-projects-issues
Copy link
Collaborator Author

Ken Young commented

The annotation that I was missing was

@EnableAsync(proxyTargetClass=true)

I used an interface, but I put the annotation at the implementation level.

@spring-projects-issues
Copy link
Collaborator Author

Ittai Zeidman commented

Thanks Ken!

@spring-projects-issues spring-projects-issues added type: bug A general bug status: invalid An issue that we don't feel is valid in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug A general bug label Jan 12, 2019
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: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

1 participant