On Oct 15, 6:09 am, koba <
tetsu.k...@gmail.com> wrote:
> I guess,
> int ii = (int)(*env)->CallIntMethod(env, jcCallback ,mid, 444 );
> should be
> int ii = (int)(*env)->CallIntMethod(env, this, mid, 444 );
>
> Check the second argument of CallIntMethod.
The second argument should be the target of the virtual call, not the
class object. However, the change above isn't sufficient.
"setConnecCallback2" is declared "public static native void
setConnecCallback2()" in Java, so the second argument to
setConnecCallback2 is actually "jclass clazz" rather than "jobject
this".
What's lacking here is an instance of "com.ServersService". It's
calling an instance method without an instance. I can't be sure from
just the code fragment, but it looks like declaring setConnecCallback2
as non-static in the Java source and applying the above change would
solve the problem.