J
jobs239
I have a C++ program that calls into JAVA through JNI interface.
Everything works fine with jdk1.4.2 but with JDK 1.5 I get the error
FATAL ERROr in native method : wrong object class or method id passed
to JNI call
at the line CallObjectMethod
Here's the code snippet:
jclass cls = env->FindClass("myclass");
jmethodID mid = env->GetMethodID(cls, "getdata",
"(ILjava/lang/String;Ljava/lang/StringLjava/lang/Object;");
jstring jcon = env->NewStringUTF(iStr);
jstring jwork = env->NewStringUTF(wStr);
jobject jo = env->CallObjectMethod(cls,mid,1,jcon, jwork);
Everything works fine with jdk1.4.2 but with JDK 1.5 I get the error
FATAL ERROr in native method : wrong object class or method id passed
to JNI call
at the line CallObjectMethod
Here's the code snippet:
jclass cls = env->FindClass("myclass");
jmethodID mid = env->GetMethodID(cls, "getdata",
"(ILjava/lang/String;Ljava/lang/StringLjava/lang/Object;");
jstring jcon = env->NewStringUTF(iStr);
jstring jwork = env->NewStringUTF(wStr);
jobject jo = env->CallObjectMethod(cls,mid,1,jcon, jwork);