From 2888f2b86f3f1606be144388628066680e9bee8b Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Wed, 20 Apr 2011 11:58:00 +0100 Subject: [PATCH] SEC-1720: Avoid bean-creation side-effects in ContextSourceSettingPostProcessor. --- .../config/ldap/ContextSourceSettingPostProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/src/main/java/org/springframework/security/config/ldap/ContextSourceSettingPostProcessor.java b/config/src/main/java/org/springframework/security/config/ldap/ContextSourceSettingPostProcessor.java index 3fa3c5b2e8..f867d7b27f 100644 --- a/config/src/main/java/org/springframework/security/config/ldap/ContextSourceSettingPostProcessor.java +++ b/config/src/main/java/org/springframework/security/config/ldap/ContextSourceSettingPostProcessor.java @@ -36,12 +36,12 @@ class ContextSourceSettingPostProcessor implements BeanFactoryPostProcessor, Ord "jar file in your application", e); } - String[] sources = bf.getBeanNamesForType(contextSourceClass); - + String[] sources = bf.getBeanNamesForType(contextSourceClass, false, false); if (sources.length == 0) { throw new ApplicationContextException("No BaseLdapPathContextSource instances found. Have you " + - "added an <" + Elements.LDAP_SERVER + " /> element to your application context?"); + "added an <" + Elements.LDAP_SERVER + " /> element to your application context? If you have " + + "declared an explicit bean, do not use lazy-init"); } if (!bf.containsBean(BeanIds.CONTEXT_SOURCE) && defaultNameRequired) {