diff --git a/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java b/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java index dffe548fe8..d1730607d5 100644 --- a/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java +++ b/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java @@ -81,7 +81,9 @@ public class FactoryFinder { String uri = path + key; // lets try the thread context class loader first - InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + if (classLoader == null) classLoader = getClass().getClassLoader(); + InputStream in = classLoader.getResourceAsStream(uri); if (in == null) { in = FactoryFinder.class.getClassLoader().getResourceAsStream(uri); if (in == null) {