{"record":{"id":"3eef1195fef3f56d","repo":"oracle/graal","slug":"no-such-method-s","errorCode":null,"errorMessage":"No such method: %s","messagePattern":"No such method: (.+?)","errorType":"exception","errorClass":"InternalError","httpStatus":null,"severity":"critical","filePath":"compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/truffle/FromLibGraalCalls.java","lineNumber":95,"sourceCode":"\n    @SuppressWarnings(\"unchecked\")\n    public final <R extends JObject> R callJObject(JNIEnv env, T id, JValue args) {\n        JNIMethodImpl<T> method = getJNIMethod(env, id, Object.class);\n        return hotSpotCalls.callStaticJObject(env, peer, method, args);\n    }\n\n    private JNIMethodImpl<T> getJNIMethod(JNIEnv env, T hcId, Class<?> expectedReturnType) {\n        assert hcId.getReturnType() == expectedReturnType || expectedReturnType.isAssignableFrom(hcId.getReturnType());\n        try {\n            return methods.computeIfAbsent(hcId, new Function<T, JNIMethodImpl<T>>() {\n                @Override\n                public JNIMethodImpl<T> apply(T id) {\n                    JClass c = peer;\n                    String methodName = id.getMethodName();\n                    try (CCharPointerHolder name = CTypeConversion.toCString(methodName); CCharPointerHolder sig = CTypeConversion.toCString(id.getSignature())) {\n                        JMethodID jniId = JNIUtil.GetStaticMethodID(env, c, name.get(), sig.get());\n                        if (jniId.isNull()) {\n                            throw new InternalError(\"No such method: \" + methodName);\n                        }\n                        return new JNIMethodImpl<>(id, jniId);\n                    }\n                }\n            });\n        } catch (InternalError ie) {\n            JNIExceptionWrapper.wrapAndThrowPendingJNIException(env);\n            throw ie;\n        }\n    }\n\n    /**\n     * Describes a method in HotSpot peer class}.\n     */\n    private static final class JNIMethodImpl<T extends Enum<T> & FromLibGraalId> implements JNIMethod {\n        final T hcId;\n        final JMethodID jniId;\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/truffle/FromLibGraalCalls.java#L77-L113","documentation":"FromLibGraalCalls.getJNIMethod looks up a host-side static method via JNI GetStaticMethodID using a method name and signature derived from a call id. If JNI returns a null JMethodID, no method with that exact name/signature exists on the peer class, and it throws InternalError('No such method: ' + methodName) after wrapping any pending JNI exception. This almost always indicates the libgraal image and the host JVM expose mismatched APIs.","triggerScenarios":"libgraal calling back into the host JVM for a method whose name or descriptor changed — e.g. a host class was compiled from a different GraalVM version, or a refactor renamed/overloaded the expected static method.","commonSituations":"Mixing a libgraal image built from one GraalVM build with a host JVM of another version; recent method signature changes in the interop API; classpath shadowing so the peer class resolves to a stale copy.","solutions":["Ensure the libgraal image and the host JVM runtime come from the exact same GraalVM release.","Rebuild the native libgraal image after any change to the interop/callback classes.","Check for duplicate/stale copies of the peer class on the classpath (shadowed jars).","Inspect the pending JNI exception (JNIExceptionWrapper surfaces it) to confirm the NoSuchMethodError target."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    support.enterLibgraal(...);\n} catch (InternalError e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"No such method\")) {\n        // peer API mismatch: verify both sides use the same GraalVM build, then restart\n    }\n}","preventionTips":["Ship the libgraal image and host runtime from the same GraalVM release","Rebuild the image after changing interop classes","Check for shadowed/stale peer classes on the classpath"],"tags":["libgraal","jni","version-mismatch","internal-error"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}