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

SEC-2773: Non-static declaration of ApplicationListener bean causes premature initialization #2910

Closed
spring-issuemaster opened this issue Nov 27, 2014 · 2 comments
Assignees
Milestone

Comments

@spring-issuemaster
Copy link

@spring-issuemaster spring-issuemaster commented Nov 27, 2014

Oliver Gierke (Migrated from SEC-2773) said:

The fix for SEC-2574 introduced an @Bean method declaring a DelegatingApplicationListener on WebSecurityConfiguration. ApplicationListeners are looked up very early in the container lifecycle and due to the declaring method being an instance method the container needs to initialize the configuration class in its entirety. This in turn causes the container having to lookup the parameters of setFilterChainProxySecurityConfigurer(…) on a by-type basis which causes initializations of a lot of Factory beans and other configuration classes.

Changing the bean declaration to be a static method, prevents the need for the premature instantiation of the configuration class. Pull request coming.

@spring-issuemaster

This comment has been minimized.

Copy link
Author

@spring-issuemaster spring-issuemaster commented Nov 27, 2014

Oliver Gierke said:

Pull request: #147

@spring-issuemaster

This comment has been minimized.

Copy link
Author

@spring-issuemaster spring-issuemaster commented Dec 1, 2014

Rob Winch said:

Thanks for the PR! I have merged this into master and 3.2.x.

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