pinpoint-apm/pinpoint · critical · IllegalStateException

JavaLangAccess not found

Error message

JavaLangAccess not found

What it means

JavaLangAccessHelper.newJavaLangAccessor probes for JavaLangAccess implementations (JavaLangAccess9/11, etc.) and throws IllegalStateException('JavaLangAccess not found') when none can be loaded. Without this internal access the agent cannot define classes on JDK9+, so it fails fast at accessor creation.

Source

Thrown at agent-module/profiler-optional/profiler-optional-jdk9/src/main/java/com/navercorp/pinpoint/profiler/instrument/classloading/JavaLangAccessHelper.java:69

    private static JavaLangAccess newJavaLangAccessor()  {
        try {
            Class.forName(MISC_JAVA_LANG_ACCESS_CLASS_NAME, false, JavaLangAccess.class.getClassLoader());
            return new JavaLangAccess9();
        } catch (ClassNotFoundException ignored) {
            // ignore
        }
        try {
            // https://github.com/naver/pinpoint/issues/6752
            // Oracle JDK11 : jdk.internal.access
            // openJDK11 =  jdk.internal.misc
            Class.forName(ACCESS_SHARED_SECRETS_CLASS_NAME, false, JavaLangAccess.class.getClassLoader());
            return new JavaLangAccess11();
        } catch (ClassNotFoundException ignored) {
            // ignore
        }

        dumpJdkInfo();
        throw new IllegalStateException("JavaLangAccess not found");
    }
}

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Upgrade pinpoint to a version supporting your exact JDK version
  2. Add --add-exports jdk.internal.misc=ALL-UNNAMED (and related flags) for the JDK
  3. Check dumpJdkInfo() output to confirm the detected JDK internals
  4. Run the agent on a JDK supported by your agent version

Example fix

// before: JDK17 with old agent
java -jar pinpoint-agent ... // IllegalStateException JavaLangAccess not found
// after: upgrade agent or grant access
java --add-exports jdk.internal.misc=ALL-UNNAMED -jar pinpoint-agent...
Defensive patterns

Strategy: fallback

Validate before calling

try {
    Class.forName("jdk.internal.misc.SharedSecrets");
} catch (ClassNotFoundException e) {
    // unsupported JDK internals
}

Type guard

boolean supportsJavaLangAccess() {
    try { JavaLangAccessHelper.getJavaLangAccess(); return true; }
    catch (IllegalStateException e) { return false; }
}

Try / catch

try {
    accessor = JavaLangAccessHelper.getJavaLangAccess();
} catch (IllegalStateException e) {
    logger.warn("JavaLangAccess unavailable on this JDK", e);
    // fall back to ClassLoader.defineClass reflection or disable instrumentation
}

Prevention

When it happens

Trigger: Calling JavaLangAccessHelper.getJavaLangAccess()/JAVA_LANG_ACCESS initialization on a JDK version whose JavaLangAccess accessor class (e.g. JavaLangAccess11) is not present or whose internal jdk.internal APIs moved/renamed.

Common situations: Running an older pinpoint agent on a newer JDK (e.g. JDK 12+ removed JavaLangAccess9 path, agent only knows up to 11); missing --add-exports for jdk.internal.misc; unsupported early-access JDK.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/235e940bc7e36845. Report an issue: GitHub.