applied patch for AMQ-1229 with thanks!

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@546485 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2007-06-12 13:53:37 +00:00
parent 45f6a87244
commit 5cb9419373
1 changed files with 11 additions and 4 deletions

View File

@ -67,10 +67,17 @@ public class FactoryFinder {
if (className == null) {
throw new IOException("Expected property is missing: " + propertyPrefix + "class");
}
Class clazz;
try {
clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
} catch (ClassNotFoundException e) {
Class clazz = null;
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader != null) {
try {
clazz = loader.loadClass(className);
}
catch (ClassNotFoundException e) {
// ignore
}
}
if (clazz == null) {
clazz = FactoryFinder.class.getClassLoader().loadClass(className);
}