Make WS communications more robust
git-svn-id: https://svn.argeo.org/slc/trunk@1292
4cfe0d0a-d680-48aa-b62c-
e0a02a3f76cc
import org.apache.commons.logging.Log;\r
import org.apache.commons.logging.LogFactory;\r
import org.argeo.slc.core.SlcException;\r
import org.apache.commons.logging.Log;\r
import org.apache.commons.logging.LogFactory;\r
import org.argeo.slc.core.SlcException;\r
+import org.springframework.beans.BeanUtils;\r
+import org.springframework.beans.factory.BeanFactoryUtils;\r
import org.springframework.beans.factory.ListableBeanFactory;\r
import org.springframework.core.io.DefaultResourceLoader;\r
import org.springframework.core.io.Resource;\r
import org.springframework.beans.factory.ListableBeanFactory;\r
import org.springframework.core.io.DefaultResourceLoader;\r
import org.springframework.core.io.Resource;\r
\r
public static <T> T loadSingleFromContext(ListableBeanFactory context,\r
Class<T> clss) {\r
\r
public static <T> T loadSingleFromContext(ListableBeanFactory context,\r
Class<T> clss) {\r
- Map<String, T> beans = context.getBeansOfType(clss);\r
+ // Map<String, T> beans = context.getBeansOfType(clss);\r
+ Map<String, T> beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(\r
+ context, clss);\r
if (beans.size() == 1) {\r
return beans.values().iterator().next();\r
} else {\r
if (beans.size() == 1) {\r
return beans.values().iterator().next();\r
} else {\r