mirror of https://github.com/apache/openjpa.git
OPENJPA-2227: OpenJPA doesn't find custom SequenceGenerators
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1367126 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
423d1d18e4
commit
5c05a69ce6
|
@ -276,9 +276,18 @@ public class SequenceMetaData
|
||||||
plugin.setString(_plugin);
|
plugin.setString(_plugin);
|
||||||
String clsName = plugin.getClassName();
|
String clsName = plugin.getClassName();
|
||||||
|
|
||||||
Class cls = Class.forName(clsName, true,
|
Class cls = null;
|
||||||
AccessController.doPrivileged(
|
try {
|
||||||
J2DoPrivHelper.getClassLoaderAction(Seq.class)));
|
cls = Class.forName(clsName, true,
|
||||||
|
AccessController.doPrivileged(J2DoPrivHelper.getClassLoaderAction(Seq.class)));
|
||||||
|
} catch (ClassNotFoundException cnfe) {
|
||||||
|
// Target sequence type is loaded by the ClassLoader responsible for OpenJPA classes.
|
||||||
|
// This can happen if the custom sequence implementation is a class that belongs to
|
||||||
|
// a child ClassLoader - a situation that can easily happen in a JEE environment.
|
||||||
|
// Fall back to the envLoader to try load the class.
|
||||||
|
cls = Class.forName(clsName, true, envLoader);
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder props = new StringBuilder();
|
StringBuilder props = new StringBuilder();
|
||||||
if (plugin.getProperties() != null)
|
if (plugin.getProperties() != null)
|
||||||
props.append(plugin.getProperties());
|
props.append(plugin.getProperties());
|
||||||
|
|
Loading…
Reference in New Issue