{"record":{"id":"2f15eb3844111560","repo":"oracle/graal","slug":"calling-unimplemented-mokapot-s","errorCode":null,"errorMessage":"Calling unimplemented mokapot %s","messagePattern":"Calling unimplemented mokapot (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"espresso/src/com.oracle.truffle.espresso.mokapot/include/mokapot.h","lineNumber":45,"sourceCode":"#include \"jni.h\"\n#include \"os.h\"\n\n#include \"libjavavm_dynamic.h\"\n\n#include <stddef.h>\n#include <stdint.h>\n\nstruct MokapotNativeInterface_;\nstruct MokapotEnv_;\n\n#ifdef __cplusplus\ntypedef MokapotEnv_ MokapotEnv;\n#else\ntypedef const struct MokapotNativeInterface_ *MokapotEnv;\n#endif\n\n#define UNIMPLEMENTED(name) \\\n  fprintf(stderr, \"Calling unimplemented mokapot %s\" OS_NEWLINE_STR, #name);\n\n#define IMPLEMENTED(name) do {} while (0);\n\n// Methods implemented in C (not Java call)\n#define NATIVE(name) do {} while (0);\n\n// Additional Java basic types\n\ntypedef uint8_t  jubyte;\ntypedef uint16_t jushort;\ntypedef uint32_t juint;\ntypedef uint64_t julong;\n\n// A VM created from espresso host Java code through initializeMokapotContext\n#define MOKA_RISTRETTO ((void *)11)\n// A VM created from JNI_CreateJavaVM\n#define MOKA_LATTE ((void *)22)\n// A MOKA_RISTRETTO VM that is used by a MOKA_LATTE VM","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso.mokapot/include/mokapot.h#L27-L63","documentation":"Printed by the UNIMPLEMENTED(name) macro in mokapot.h when native code calls a JNI/POSIX-style entry point that mokapot (Espresso's C-level JVM interface, the JNI replacement layer) has not implemented yet. It writes to stderr and returns; execution continues, so the call silently does nothing rather than crashing. Seeing it means guest native code exercised a JNI surface area the embedded JVM does not cover.","triggerScenarios":"Guest native libraries calling less-common JNI functions (e.g. DefineClass variants, certain monitor/JNI reflection slots) whose mokapot stub is generated with UNIMPLEMENTED instead of a real body.","commonSituations":"Running third-party native libraries (database drivers, crypto, compression) inside Espresso/native-image; upgrading a library that starts using a JNI function nobody had called before.","solutions":["Identify the exact function name from the stderr line ('Calling unimplemented mokapot <name>')","Check the Espresso/GraalVM release notes for newly implemented JNI entry points and upgrade","Recompile the native library against a restricted JNI API, or replace the call path with a Java-side equivalent","Report the missing entry point to the Espresso maintainers with a reproducer"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Smoke-test native library entry points inside Espresso before shipping","Monitor stderr for 'Calling unimplemented mokapot' during test runs","Track GraalVM release notes for JNI coverage improvements and upgrade promptly"],"tags":["espresso","mokapot","jni","native","c"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}