--
You received this message because you are subscribed to the Google Groups "Avian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avian+un...@googlegroups.com.
To post to this group, send email to av...@googlegroups.com.
Visit this group at http://groups.google.com/group/avian.
For more options, visit https://groups.google.com/d/optout.
Or, if it's just aborting without any error output, please provide a list of steps to reproduce it and I'll see if I can debug it.
1: jclass cls = env->FindClass("com/test/HelloNative");
2: jmethodID constructor = env->GetMethodID(cls, "<init>", "()V");
3: jobject obj = env->NewObject(cls, constructor);
the application crashes on line 2 with "Abort trap: 6" error.
Looks like the same error on thread "GetMethodID returns 0x1".
Thanks in advance.
Is FindClass returning null? If so, that's the problem, and it means that the VM can't find the class you asked for (i.e. the classpath specified incorrectly when the VM was initialized). You can add a call to ExceptionDescribe to print the Java exception trace if that's what's happening. It's a good idea to try adding ExceptionCheck and ExceptionDescribe calls to your JNI code when debugging issues like this.
Thanks for following up. I don't know why AllocObject even exists in the JNI spec, but I guess we'd better implement it. I'll post a PR when I get a chance.
Visit this group at https://groups.google.com/group/avian.