{"record":{"id":"ca1f1ae317a36fe9","repo":"oracle/graal","slug":"getjavavm-not-a-moka-ristretto","errorCode":null,"errorMessage":"GetJavaVM: not a MOKA_RISTRETTO","messagePattern":"GetJavaVM: not a MOKA_RISTRETTO","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso.native/src/nespresso.c","lineNumber":483,"sourceCode":"\n  moka_env = (MokapotEnv*) (*env)->reserved1;\n  if (moka_env == NULL) {\n    fprintf(stderr, \"GetJavaVM: Passed JNIEnv* has no MokapotEnv* associated\" OS_NEWLINE_STR);\n    return JNI_ERR;\n  }\n\n  vm = (*moka_env)->vm;\n\n  // If there's an isolate-aware JavaVM, find it.\n  if ((*vm)->reserved1 == MOKA_AMERICANO) {\n    vm = (JavaVM*) (*vm)->reserved2;\n    // MOKA_AMERICANO JavaVM can only point to a MOKA_LATTE.\n    if ((*vm)->reserved1 != MOKA_LATTE) {\n      fprintf(stderr, \"GetJavaVM: not a MOKA_LATTE\" OS_NEWLINE_STR);\n      return JNI_ERR;\n    }\n  } else if ((*vm)->reserved1 != MOKA_RISTRETTO) {\n    fprintf(stderr, \"GetJavaVM: not a MOKA_RISTRETTO\" OS_NEWLINE_STR);\n    return JNI_ERR;\n  }\n\n  *vmPtr = vm;\n  return JNI_OK;\n}\n\nstatic void unset_function_error() {\n  fprintf(stderr, \"Call to uninitialized JNI function slot\" OS_NEWLINE_STR);\n  exit(-1);\n}\n\nJNIEXPORT JNIEnv* JNICALL initializeNativeContext(void* (*fetch_by_name)(const char *)) {\n  JNIEnv* env = (JNIEnv*) malloc(sizeof(*env));\n  struct JNINativeInterface_* jni_impl = malloc(sizeof(*jni_impl));\n  struct NespressoEnv* nespresso_env = (struct NespressoEnv*) malloc(sizeof(*nespresso_env));\n\n  jni_impl->reserved0 = nespresso_env;","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso.native/src/nespresso.c#L465-L501","documentation":"Error \"GetJavaVM: not a MOKA_RISTRETTO\" thrown in oracle/graal.","triggerScenarios":"Thrown at espresso/src/com.oracle.truffle.espresso.native/src/nespresso.c:483 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: GetJavaVM: not a MOKA_RISTRETTO","solutions":["Fix the condition reported by the error: GetJavaVM: not a MOKA_RISTRETTO","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: GetJavaVM: not a MOKA_RISTRETTO","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"}