From eb19487b669838127429e5e1e0c50fe1391b20af Mon Sep 17 00:00:00 2001 From: Dain Sundstrom Date: Wed, 28 Feb 2007 22:05:55 +0000 Subject: [PATCH] If thread context class loader is null use the class loader of the FactoryFinder class git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@513003 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/activemq/util/FactoryFinder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {