Saturday 15 January 2011

java - Exception Signal 11 using JNI CallBooleanMethod -


I am going to signal 11 in this line:

  // call is bull Internet connection () Jboolean jReturnValue = env- & gt; Callbolley System (mClass, Middle);   

In this part of the code:

  / ** * Check that the internet connection is online / / bool interface JNI :: is Internet connect () {JavaVM * Jvm = JniHelper :: getJavaVM (); Integer position; JNIEnv * env; JmethodID Middle; Bull has been attached = false; Bool returnValue = false; CCLog ("InterfaceNINInternet Connected"); // Get Status Status = jvm- & gt; GetEnv ((Zero **) & amp; env, JNI_VERSION_1_6); If (status & lt; 0) {ccolog ("the Internet connected state & lt; 0 JNI failed to get the environment !!!"); Status = jvm-> Attackercantrade (& amp; NV; Faucet); CCLog ("Internet connected status position 2:% d", position); If (status & lt; 0) {CCLog ("Internet connect connected status <"; !!!); return false; } IsAttached = true; CCLog ("Internet connected status is attached:% D", attached); } CCLog ("Internet connected status:% d", position); CCLog ("Internet connected search class ...."); Jclass mClass = env- & gt; FindClass ("org / example / social network / CCSocialNetwork"); // Static Bull HoOInternet Connection (CCLog) ("Interant Connect Connect Method ...."); Mid = avi-> Guitmethid (mClass, "Internet connection", "() Z"); If (middle == 0) {ccolog ("the Internet connected failed status static state"); return false; } CCLog ("Internet connection is connecting method ...."); // CallBull is Internet connection (jboolean jReturnValue = env- & gt; Callbolley System (mClass, Middle); CCLog ("Called"); // Convert to value from Java to C + return value = (bool) jReturnValue; CCLog ("Internet connected"); If (Attached) jvm- & gt; DetectorThread (); // Change the return value for refund; }   

But I do not know why if I make a zero call with "() V", then works fine, but when I try to call the function which is a Bool returns the number.

What's going on?

Is this a stable way or not? Your comments in the code indicate that your method is steady when calling.

If this not is stable, then you have to call CallBooleanMethod with no object and now you do not have a class like you else, otherwise you will see the CallStaticBooleanMethod should be used with the class.

  Some objects about the job =   

OR

  jboolean jReturnValue = env-> callstalkBoline method (mClass, middle);   

In either way you have to decide whether to use the static method or not.

No comments:

Post a Comment