diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/QueryCompilationCacheValue.java b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/QueryCompilationCacheValue.java index bbaebdd82..093a81065 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/QueryCompilationCacheValue.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/QueryCompilationCacheValue.java @@ -26,6 +26,7 @@ import org.apache.openjpa.lib.conf.Configuration; import org.apache.openjpa.lib.conf.PluginValue; import org.apache.openjpa.lib.util.concurrent.ConcurrentMap; import org.apache.openjpa.lib.util.concurrent.ConcurrentHashMap; +import org.apache.openjpa.lib.util.ParseException; import org.apache.openjpa.util.CacheMap; /** @@ -58,6 +59,18 @@ public class QueryCompilationCacheValue try { map = (Map) super.newInstance(clsName, type, conf, fatal); + } catch (ParseException pe) { + // OPENJPA256: this class differs from most plugins in that + // the plugin type is the standard java interface Map.class (rather + // than an openjpa-specific interface), which means that the + // ClassLoader used to load the implementation will be the system + // class loader; this presents a problem if OpenJPA is not in the + // system classpath, so work around the problem by catching + // the ParseException (which is what we wrap the + // ClassNotFoundException in) and try again, this time using + // this class' ClassLoader. + map = (Map) super.newInstance(clsName, + QueryCompilationCacheValue.class, conf, fatal); } catch (IllegalArgumentException iae) { // OPENJPA256: this class differs from most plugins in that // the plugin type is the standard java interface Map.class (rather diff --git a/openjpa-project/CHANGES.txt b/openjpa-project/CHANGES.txt index 3a6a28f68..de76446c3 100644 --- a/openjpa-project/CHANGES.txt +++ b/openjpa-project/CHANGES.txt @@ -282,6 +282,8 @@ Bugs fixed * [OPENJPA-321] - DB2 ABS Casting problem * [OPENJPA-322] - Timezone on the Calendar object lost in proxying * [OPENJPA-323] - Cleanup some message text + * [OPENJPA-256] - java.lang.ClassNotFoundException: + org.apache.openjpa.util.CacheMap in a jetty spring environment Sub-task diff --git a/openjpa-project/RELEASE-NOTES.html b/openjpa-project/RELEASE-NOTES.html index 325344f94..a8e8bcbd4 100644 --- a/openjpa-project/RELEASE-NOTES.html +++ b/openjpa-project/RELEASE-NOTES.html @@ -275,6 +275,8 @@ Additional testing done for release 0.9.7