Index: AbstractFactoryRegistry.java =================================================================== --- AbstractFactoryRegistry.java (revision 1987) +++ AbstractFactoryRegistry.java (working copy) @@ -251,27 +251,24 @@ private static List list(ClassLoader classLoader) { ClassLoader cl = classLoader; - if (cl == null) - { - cl = Thread.currentThread().getContextClassLoader(); + ClassLoaders loaders = new ClassLoaders(); + cl = AbstractFactoryRegistry.class.getClassLoader(); + if (cl != null) { + loaders.put(cl); } - if (cl == null) - { - cl = AbstractFactoryRegistry.class.getClassLoader(); + cl = Thread.currentThread().getContextClassLoader(); + if (cl != null) { + loaders.put(cl); } - if (cl == null) - { - cl = JDKHooks.getJDKHooks().getSystemClassLoader(); + cl = JDKHooks.getJDKHooks().getSystemClassLoader(); + if (cl != null) { + loaders.put(cl); } - if (cl == null) - { + if (loaders.size() == 0) { // this is not our day. bail out. return Collections.EMPTY_LIST; } - ClassLoaders loaders = new ClassLoaders(); - loaders.put(cl); - List registries = new ArrayList(); Enumeration providers = Service.providers( new SPInterface(AbstractFactoryRegistry.class), loaders);