From 5cb94193734ac76f2370630d87f20396fbd3b407 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Tue, 12 Jun 2007 13:53:37 +0000 Subject: [PATCH] applied patch for AMQ-1229 with thanks! git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@546485 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/util/FactoryFinder.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 d1730607d5..584604ea36 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 @@ -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); }