1
0
mirror of synced 2026-08-04 17:27:13 +00:00

SEC-933: global-method-security and aop:aspectj-autoproxy throws NullPointerException in some situations

http://jira.springframework.org/browse/SEC-933. Removed the setting of the attributeSource field from the interceptor in MethodDefinitionSourceAdvisor as this was overwriting the version supplied with the constructor with null (causing the NPE).
Also implemented lazy initialization of the authentication provider list from the bean factory in a custom NamespaceAuthenticationManager (extends ProviderManager and introspects the BeanFactory when getProviders() is first called). This should prevent the perennial problem of the eager initialization of UserDetailsService and other beans when the interceptor is eagerly initialized by something like aspectj-autoproxy.
This commit is contained in:
Luke Taylor
2008-07-30 11:01:23 +00:00
parent f538a36cd3
commit 4bb3eb12c3
15 changed files with 114 additions and 42 deletions
@@ -119,10 +119,11 @@ public class ProviderManagerTests {
}
@Test(expected=IllegalArgumentException.class)
public void startupFailsIfProviderListNotSet() throws Exception {
public void getProvidersFailsIfProviderListNotSet() throws Exception {
ProviderManager mgr = new ProviderManager();
mgr.afterPropertiesSet();
mgr.getProviders();
}
@Test(expected=IllegalArgumentException.class)