diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java index a9c0675d1..4c4bd9010 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java @@ -92,9 +92,10 @@ public class ObjectValue extends Value { ClassLoader cl = (ClassLoader) _classloaderCache.get(type); if (cl == null) { cl = type.getClassLoader(); - if (cl != null) { // System classloader is returned as null - _classloaderCache.put(type, cl); + if (cl == null) { // System classloader is returned as null + cl = ClassLoader.getSystemClassLoader(); } + _classloaderCache.put(type, cl); } return Configurations.newInstance(clsName, this, conf, cl, fatal); }