Use the current thread's classloader in addition to the configuration class'

loader when loading globals.



git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@497634 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
A. Abram White 2007-01-18 23:21:41 +00:00
parent a40baca273
commit e2665ce5dd
1 changed files with 5 additions and 2 deletions

View File

@ -55,6 +55,7 @@ import org.apache.openjpa.lib.log.LogFactoryImpl;
import org.apache.openjpa.lib.log.NoneLogFactory; import org.apache.openjpa.lib.log.NoneLogFactory;
import org.apache.openjpa.lib.util.Closeable; import org.apache.openjpa.lib.util.Closeable;
import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.lib.util.Localizer;
import org.apache.openjpa.lib.util.MultiClassLoader;
import org.apache.openjpa.lib.util.ParseException; import org.apache.openjpa.lib.util.ParseException;
import org.apache.openjpa.lib.util.Services; import org.apache.openjpa.lib.util.Services;
import org.apache.openjpa.lib.util.StringDistance; import org.apache.openjpa.lib.util.StringDistance;
@ -158,8 +159,10 @@ public class ConfigurationImpl
* {@link ProductDerivation}s, and from System properties. * {@link ProductDerivation}s, and from System properties.
*/ */
public boolean loadGlobals() { public boolean loadGlobals() {
ConfigurationProvider provider = ProductDerivations.loadGlobals MultiClassLoader loader = new MultiClassLoader();
(getClass().getClassLoader()); loader.addClassLoader(Thread.currentThread().getContextClassLoader());
loader.addClassLoader(getClass().getClassLoader());
ConfigurationProvider provider = ProductDerivations.loadGlobals(loader);
if (provider != null) if (provider != null)
provider.setInto(this); provider.setInto(this);