Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean ProtectionDomain in acc failed. #446

Closed
yupd opened this issue Nov 1, 2023 · 1 comment
Closed

clean ProtectionDomain in acc failed. #446

yupd opened this issue Nov 1, 2023 · 1 comment

Comments

@yupd
Copy link

yupd commented Nov 1, 2023

jdk 版本

java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode)

找不到方法

java.lang.NoSuchMethodException: java.security.AccessControlContext.getContext()

解决方法

private void cleanProtectionDomainWhichCameFromModuleJarClassLoader() {

        // got ProtectionDomain[] from URLClassLoader's acc
        final AccessControlContext acc = unCaughtGetClassDeclaredJavaFieldValue(URLClassLoader.class, "acc", this);
        //final ProtectionDomain[] protectionDomainArray = unCaughtInvokeMethod(
        //        unCaughtGetClassDeclaredJavaMethod(AccessControlContext.class, "getContext"),
        //        acc
        //);

       // 通过反射字段获取值,增加jdk兼容性
       final ProtectionDomain[] protectionDomainArray = unCaughtGetClassDeclaredJavaFieldValue(AccessControlContext.class, "context", acc);

}
@z529192557
Copy link
Collaborator

目前最新版本的sandbox最低jdk要求是jdk8

@yupd yupd closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants