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
This commit is contained in:
Dain Sundstrom 2007-02-28 22:05:55 +00:00
parent 44bafc3e03
commit eb19487b66
1 changed files with 3 additions and 1 deletions

View File

@ -81,7 +81,9 @@ public class FactoryFinder {
String uri = path + key; String uri = path + key;
// lets try the thread context class loader first // 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) { if (in == null) {
in = FactoryFinder.class.getClassLoader().getResourceAsStream(uri); in = FactoryFinder.class.getClassLoader().getResourceAsStream(uri);
if (in == null) { if (in == null) {