1 Reply Latest reply on Jul 25, 2007 8:33 PM by 843810

    Usage of SetJNIFunctionTable fails


      I'm playing with function interception and want to set my own function table. When I leave the line with SetJNIFunctionTable in the code, the JVM crashes at startup. When I remove the line, it starts, but of course without my interception.

      What could be wrong? Has anybody used SetJNIFunctionTable successfully? Help appreciated.

      Here are parts of the code (beware, it's C ;-) The GetJNIFunctionTable call returns without error.
      static jniNativeInterface redirectedJniFunctions;
      error = (*jvmti)->GetJNIFunctionTable(jvmti, &redirectedJniFunctions);
      redirectedJniFunctions.NewGlobalRef = myNewGlobalRef;
      error = (*jvmti)->SetJNIFunctionTable(jvmti, &redirectedJniFunctions);