After reading the static field and get the object I go into the loop iterating over the array to read all values. All goes well, I can read every single arraylist entry, the label string, the double value and can access the array of integers with a nested loop. Within the nested loop if fetch the integer array entry with getObjectArrayElement and it seems to get that value. Afterwards I test it on NULL and it is not NULL. To be pedantic I I double check if that array entry (of the integer array) is an instance of Integer with isInstanceOf. That very call crashes my program with SIGSEGV and JVM bails out.

I do not understand why it crashes there, even though I seem not to be able to access that field for reading (with GetIntField() for example). If I leave out the isInstanceOf call (just looping over the integer array) all goes fine, it loops over the complete arraylist, reads my strings and doubles, loops over the nested integer array and finishes successfully. Honestly the

Does anybody have a hint for me where to look or what to improve? I hope the provided code snippet of the arraylist reader function is complete enough to understand my problem. Maybe somebody can point me to the right direction on this issue, hopefully :-))

Update 2010/12/06:
==================
As Peter suggested, I completely reworked the object reader function using the
Java methods of the object through the native interface. Additionally it
turned out, that I even do not need that very arraylist I constructed in
the Java class, I rather used and read the internal class Results Object
List directly and its object methods to read the results I need. So in short,
now it is more efficient and I was able to skip that Arraylist construction
completey and spare one processing step.
First I thought, using the Java methods of that very class through JNI would
give me a much higher response time, using Java methods through JNI is surely
not very fast (compared to using the Java methods in Java directly). Using JNI
as a bridge from C to Java costs performance and computing time. But anyway, I
figured out, I am about 200ms faster (using the same data set) than my old
reader method with the arraylist, so I even gained some performance.
Ok, to put it in short, using JNI and the Object methods of the Java class
spared me a lot of headache and the code now is much more readable.
Conclusion: I would like to encourage everybody that is facing a similar
problem using the Object methods of the class you work with through JNI.

Thanks Peter, I understand that point ArrayList != Array. So you suggest, I should rework the complete reader function and use Java "get()" method wrapped with JNI to read all the elements? I just wonder why it all functions so far but the nested integer array does not.
–
Andreas W. WylachDec 4 '10 at 9:15