{"record":{"id":"325df31f9b684fe8","repo":"oracle/graal","slug":"method-compatible-with-not-found-in-class","errorCode":null,"errorMessage":"Method compatible with {} not found in class {}","messagePattern":"Method compatible with (.+?) not found in class (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java","lineNumber":516,"sourceCode":"        JavaType guestReturnType = method.getSignature().getReturnType(null);\n        for (Method hostMethodCandidate : hostClass.getMethods()) {\n            if (!hostMethodCandidate.getName().equals(method.getName())) {\n                continue;\n            }\n            if (!argumentsCompatible(method, hostMethodCandidate.getParameterTypes())) {\n                continue;\n            }\n            if (!typesCompatible(guestReturnType, method.getDeclaringClass(), hostMethodCandidate.getReturnType())) {\n                continue;\n            }\n            if (hostMethod == null) {\n                hostMethod = hostMethodCandidate;\n            } else {\n                throw new RuntimeException(\"Unimplemented: most specific mapping: \" + hostMethod + \" vs. \" + hostMethodCandidate);\n            }\n        }\n        if (hostMethod == null && !method.isDefault()) {\n            throw new IllegalArgumentException(\"Method compatible with \" + method.format(\"%r %h.%n(%p)\") + \" not found in class \" + hostClass.getName());\n        }\n        return hostMethod;\n    }\n\n    private boolean argumentsCompatible(ResolvedJavaMethod method, Class<?>[] hostParameterTypes) {\n        Signature guestSignature = method.getSignature();\n        int parameterCount = guestSignature.getParameterCount(false);\n        if (hostParameterTypes.length != parameterCount) {\n            return false;\n        }\n        for (int i = 0; i < parameterCount; i++) {\n            JavaType guestParameterType = guestSignature.getParameterType(i, null);\n            Class<?> hostParameterType = hostParameterTypes[i];\n            if (!typesCompatible(guestParameterType, method.getDeclaringClass(), hostParameterType)) {\n                return false;\n            }\n        }\n        return true;","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java#L498-L534","documentation":"Error \"Method compatible with {} not found in class {}\" thrown in oracle/graal.","triggerScenarios":"Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java:516 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Method compatible with {} not found in class {}","solutions":["Fix the condition reported by the error: Method compatible with {} not found in class {}","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Method compatible with {} not found in class {}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}