{"record":{"id":"3919c4749c90f644","repo":"oracle/graal","slug":"method-methodname-not-found","errorCode":null,"errorMessage":"Method ${methodName} not found","messagePattern":"Method (.+?) not found","errorType":"exception","errorClass":"GraalError","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/proxy/CompilationProxy.java","lineNumber":160,"sourceCode":"         * @param receiverClass the receiver class\n         * @param methodName the method name\n         * @param params the parameter types\n         */\n        public SymbolicMethod(Class<?> receiverClass, String methodName, Class<?>... params) {\n            this(methodName, params);\n            if (!LibGraalSupport.inLibGraalRuntime()) {\n                // Omit the check in the image to avoid increasing image size.\n                try {\n                    receiverClass.getDeclaredMethod(methodName, params);\n                    return;\n                } catch (NoSuchMethodException ignored) {\n                }\n                try {\n                    receiverClass.getMethod(methodName, params);\n                    return;\n                } catch (NoSuchMethodException ignored) {\n                }\n                throw new GraalError(\"Method \" + methodName + \" not found\");\n            }\n        }\n\n        @Override\n        public boolean equals(Object o) {\n            if (o instanceof SymbolicMethod that) {\n                return Arrays.equals(methodAndParamNames, that.methodAndParamNames);\n            }\n            return false;\n        }\n\n        @Override\n        public int hashCode() {\n            return Arrays.hashCode(methodAndParamNames);\n        }\n\n        @Override\n        public String toString() {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/proxy/CompilationProxy.java#L142-L178","documentation":"Thrown by the SymbolicMethod(Class, String, Class...) constructor when the receiver class declares (or inherits) no method with the given name and parameter types. SymbolicMethod is the name-based representation of compiler-interface methods used by replay proxies; the constructor sanity-checks in non-libgraal runtimes that the symbolic reference resolves to a real method, and GraalError reports it otherwise.","triggerScenarios":"Constructing a CompilationProxy.SymbolicMethod with a receiver class and a method name/parameter list that does not exist — getDeclaredMethod and getMethod both throw NoSuchMethodException. Common when a method was renamed, its signature changed, or the wrong receiver class is passed. The check is deliberately omitted in libgraal image builds to keep image size small.","commonSituations":"Refactoring a compiler-interface method (rename/moved parameters) without updating the symbolic reference site; version skew between the code constructing SymbolicMethod and the class it points at; typos in the method-name string.","solutions":["Fix the method name and parameter types at the SymbolicMethod construction site to match a real method on the receiver class.","If the method legitimately moved, update the receiver class argument to the new declaring class.","If this fires only in a non-libgraal run after a refactor, align both sides to the same version and rebuild."],"exampleFix":"// before\nnew SymbolicMethod(HotSpotResolvedJavaType.class, \"getMetaspaceKlass\", Long.class);\n\n// after\nnew SymbolicMethod(HotSpotResolvedJavaType.class, \"getKlassPointer\"); // match the real signature","handlingStrategy":"validation","validationCode":"// verify the symbolic method exists before building the proxy\ntry {\n    receiverClass.getMethod(methodName, params);\n} catch (NoSuchMethodException e) {\n    throw new IllegalStateException(\"SymbolicMethod target missing: \" + methodName, e);\n}\nnew CompilationProxy.SymbolicMethod(receiverClass, methodName, params);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When renaming or re-signaturing a compiler-interface method, grep for SymbolicMethod references in the same commit.","Add a unit test asserting each symbolic method constant resolves against its receiver class."],"tags":["graalvm","replay-compilation","proxy","reflection","symbolic-reference"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}