From: Mathieu Baudier Date: Thu, 26 Jun 2008 16:52:08 +0000 (+0000) Subject: Improve auto-detection of Spring beans. X-Git-Tag: argeo-slc-2.1.7~2750 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=aaa6551ed00ba292b33a19183058c5e8ec97ef64;p=gpl%2Fargeo-slc.git Improve auto-detection of Spring beans. Make WS communications more robust git-svn-id: https://svn.argeo.org/slc/trunk@1292 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/spring/SpringUtils.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/spring/SpringUtils.java index cbc5c6abf..e31dbcc59 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/spring/SpringUtils.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/spring/SpringUtils.java @@ -8,6 +8,8 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.argeo.slc.core.SlcException; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; @@ -17,7 +19,9 @@ public class SpringUtils { public static T loadSingleFromContext(ListableBeanFactory context, Class clss) { - Map beans = context.getBeansOfType(clss); + // Map beans = context.getBeansOfType(clss); + Map beans = BeanFactoryUtils.beansOfTypeIncludingAncestors( + context, clss); if (beans.size() == 1) { return beans.values().iterator().next(); } else {