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

EnableAsync breaks load order of beans [SPR-16919] #21458

spring-projects-issues opened this issue Jun 8, 2018 · 0 comments

EnableAsync breaks load order of beans [SPR-16919] #21458

spring-projects-issues opened this issue Jun 8, 2018 · 0 comments


Copy link

@spring-projects-issues spring-projects-issues commented Jun 8, 2018

Björn Eickvonder opened SPR-16919 and commented

We use Spring 4.3.17.RELEASE and started using the EnableAsync annotation.

But just adding this to a single configuration class breaks our application. At the same time we include a ConversionServiceFactoryBean to enable mapping String values in configuration to Set<String> in a bean. This works perfect, but once we add EnableAsync the ConversionServiceFactoryBean is created to late.

I traced the problem down to the following

  • The ProxyAsyncConfiguration defines a bean of type AsyncAnnotationBeanPostProcessor
  • The AbstractAsyncConfiguration uses Autowired to setConfigurers
 * Collect any {@link AsyncConfigurer} beans through autowiring.
@Autowired(required = false)
void setConfigurers(Collection<AsyncConfigurer> configurers) {

And this is somehow breaking the order how beans are instantiated, if I remove the Autowiring here it works again.

Affects: 4.3.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.