diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/JavaVersions.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/JavaVersions.java index 2eb843f27..e8c8cae1e 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/JavaVersions.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/JavaVersions.java @@ -222,7 +222,9 @@ public class JavaVersions { } static Object invokeGetter(Object target, String method) throws Exception { - return target.getClass().getMethod(method, NO_CLASS_ARGS).invoke(target, NO_ARGS); + return AccessController.doPrivileged( + J2DoPrivHelper.getDeclaredMethodAction(target.getClass(), method, NO_CLASS_ARGS)) + .invoke(target, NO_ARGS); } static boolean isParameterizedType(Object cls) {