mirror of https://github.com/apache/openjpa.git
OPENJPA-1384:
Try current classloader when loading DBDictionary. Submitted By: B.J. Reed git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@881613 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ee30b010dc
commit
27996efb48
|
@ -154,6 +154,18 @@ public class DBDictionaryFactory {
|
||||||
DBDictionary.class)));
|
DBDictionary.class)));
|
||||||
dict = (DBDictionary) AccessController.doPrivileged(
|
dict = (DBDictionary) AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.newInstanceAction(c));
|
J2DoPrivHelper.newInstanceAction(c));
|
||||||
|
} catch (ClassNotFoundException cnfe) {
|
||||||
|
// if the dictionary was not found, make another attempt
|
||||||
|
// at loading the dictionary using the current thread.
|
||||||
|
try {
|
||||||
|
Class c = Thread.currentThread().getContextClassLoader().loadClass(dclass);
|
||||||
|
dict = (DBDictionary) AccessController.doPrivileged(
|
||||||
|
J2DoPrivHelper.newInstanceAction(c));
|
||||||
|
} catch (Exception e) {
|
||||||
|
if (e instanceof PrivilegedActionException)
|
||||||
|
e = ((PrivilegedActionException) e).getException();
|
||||||
|
throw new UserException(e).setFatal(true);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e instanceof PrivilegedActionException)
|
if (e instanceof PrivilegedActionException)
|
||||||
e = ((PrivilegedActionException) e).getException();
|
e = ((PrivilegedActionException) e).getException();
|
||||||
|
|
Loading…
Reference in New Issue