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/branches/activemq-4.1@512994 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dain Sundstrom 2007-02-28 21:45:52 +00:00
parent b47be19b5f
commit d458a7943c

View File

@ -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) {