0
jclass clazz_obj = jni_env->GetObjectClass(klazz);
    
jmethodID mid = jni_env->GetMethodID(clazz_obj, "getName", "()Ljava/lang/String;");

This is the stacktrace:

V [libjvm.so+0x74e290] JvmtiRawMonitor::is_valid()+0x0

C [libVWave.so+0x73cd0] JNIEnv_::GetMethodID(_jclass*, char const*, char const*)+0x3c

I want to get the full name of a class. However, jvmti doesn't have this API. I try to do this in MethodEntry CallBack to get the full name by JNI.

Ahba1
  • 1
  • Was `clazz_obj` valid? Was there a pending exception when you called `GetMethodID()`? Don't write JNI code like this. You have to error- and exception-check *every JNI call.* – user207421 Apr 27 '22 at 07:25
  • 2
    No API in JVMTI for [getting the class name](https://docs.oracle.com/en/java/javase/17/docs/specs/jvmti.html#GetClassSignature)? – Holger Apr 27 '22 at 12:50

0 Answers0