JNI problems (findclass and vm error)

Hi,
First please apologize if this question has already been asked. I've looked at the archives and I haven't found any answer to these problems. Thanks to take the time to read this quite long post, but I've tried to be sufficiently explicit...
So, here's what I want to do: in the native code, generate a list (ArrayList) with some integers in it. I must add that I'm not a Java expert.
Here's the java code calling the native function:
package be.ac.umrtc;
public class Main {
     public native List computeRoute(int src, int dst, float reservation)
     static{
          System.loadlibrary("cspf");
     public static void main(String[] args) throws Exception{
     List path = new Main().computeRoute(lsp.getFrom(),lsp.getTo(),lsp.getReservation());
Now the native code:
#include <jni.h>
#include "be_ac_umrtc_Main.h"
JNIEXPORT void JNICALL Java_be_ac_umrtc_Main_computeRoute(JNIEnv *env, jobject obj, jint src, jint dst, jfloat reservation){
     arraylistClass = (*env)->FindClass(env,"/java/util/ArrayList");
     if (arraylistClass == NULL){
          return NULL; // exception thrown
     cid = (*env)->GetMethodID(env,arraylistClass,"<init>","()V");
     if (cid == NULL){
          return NULL; // exception thrown
     arraylist = (*env)->NewObject(env, arraylistClass, cid);
     tempClass = (*env)->GetObjectClass(env,arraylist);
     jmethodID mid = (*env)->GetMethodID(env,tempClass,"add","(Ljava/lang/Object;)Z");
     while (longListPopBack(&computedroute,&value2)!=-1){
          fprintf(stderr,"Valeur de value: %d\n", value2);
          if (mid==0){
               return;
          fprintf(stderr,"%d\n", bool = (*env)->CallBooleanMethod(env, arraylist, mid, value2));
(*env)->DeleteLocalRef(env, arraylistClass);
return arrayList;
I get a NoClassDefFoundError on java/lang/ArrayList.
So, I've tried to pass a List object "path" as argument to the native method (created in java)
and proceed with:
arraylistClass = (*env)->GetObjectClass(env,path);
instead of FindClass.
It seems to work well, the first call to callBoleanMethod returns 1. But then, the next call in the loop ends in a VM ERROR:
HotSpot Internal Error, VM Error
# HotSpot Virtual Machine Error, Internal Error
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)
# Error ID: 43113F32554E54494D45110E4350500308
# Problematic Thread: prio=1 tid=0x08052c30 nid=0x346d runnable
Heap at VM Abort:
Heap
def new generation total 576K, used 0K [0x44df0000, 0x44e90000, 0x452d0000)
eden space 512K, 0% used [0x44df0000, 0x44df02a8, 0x44e70000)
from space 64K, 0% used [0x44e80000, 0x44e80000, 0x44e90000)
to space 64K, 0% used [0x44e70000, 0x44e70000, 0x44e80000)
tenured generation total 3724K, used 2233K [0x452d0000, 0x45673000, 0x48df0000)
the space 3724K, 59% used [0x452d0000, 0x454fe540, 0x454fe600, 0x45673000)
compacting perm gen total 4096K, used 3166K [0x48df0000, 0x491f0000, 0x4cdf0000)
the space 4096K, 77% used [0x48df0000, 0x49107890, 0x49107a00, 0x491f0000)
Java Result: 129
The questions are thus:
1. why does FindClass not work?
2. why does the second call to callboleanmethod fails?
Thanks a lot for your help.
Olivier

Thanks, so now I just want to return an array of integers.
int[] computeRoute(...); in JAVA
JNIEXPORT jintArray JNICALL Java_be_ac_umrtc_Main_computeRoute(JNIEnv *env, jobject obj, jint src, jint dst, jfloat reservation){
int intarray[size];
return intarray;
does not work
I've tried casting : return (jintArray) intarray;
but no success
How can I create a jintArray? And then how to insert elements in this jintArray? I've seen in the books and the tutorial how to get element from such a jintArray passed as argument... but how to create it (how to fix size when creating it) and how to set elements is not evident to me.
Thanks for your patience.

Similar Messages

  • [SOLVED] ACPI problem - shutdown and battery error

    Hi All,
    I've installed Arch and it looks cool, but not everything work.
    I can't get acpi related infos (like battery state), or turn off my laptop. I tried hard, but i couldn't solve it.
    here are some info, if you could help me:
    -actually I can reboot flawlessly
    -i removed autodetect from the hooks list because its building lasted forever
    -lshw : http://pastebin.com/Q6Cy9Ppy
    -dmesg : http://pastebin.com/LdFTrmaC
    systemctl status systemd-udevd :
    ● systemd-udevd.service - udev Kernel Device Manager
    Loaded: loaded (/usr/lib/systemd/system/systemd-udevd.service; static)
    Active: active (running) since cs 2014-11-27 15:49:17 CET; 57min ago
    Docs: man:systemd-udevd.service(8)
    man:udev(7)
    Main PID: 136 (systemd-udevd)
    CGroup: /system.slice/systemd-udevd.service
    ├─136 /usr/lib/systemd/systemd-udevd
    ├─137 /usr/lib/systemd/systemd-udevd
    ├─138 /usr/lib/systemd/systemd-udevd
    ├─139 /usr/lib/systemd/systemd-udevd
    ├─141 /usr/lib/systemd/systemd-udevd
    ├─142 /usr/lib/systemd/systemd-udevd
    ├─143 /usr/lib/systemd/systemd-udevd
    ├─144 /usr/lib/systemd/systemd-udevd
    ├─145 /usr/lib/systemd/systemd-udevd
    └─146 /usr/lib/systemd/systemd-udevd
    nov 27 15:49:17 Arch-AcerTM4500 systemd-udevd[136]: starting version 217
    nov 27 15:50:19 Arch-AcerTM4500 systemd-udevd[136]: worker [140] /devices/pci0000:00/0000:00:1f.0/PNP0C09:00/ACPI0001:00/ACPI0002:00 is taking a long time
    nov 27 15:50:19 Arch-AcerTM4500 systemd-udevd[136]: worker [145] /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:09/PNP0C09:00/ACPI0001:00/ACPI0002:00 is taking a long time
    nov 27 15:52:19 Arch-AcerTM4500 systemd-udevd[136]: worker [140] /devices/pci0000:00/0000:00:1f.0/PNP0C09:00/ACPI0001:00/ACPI0002:00 timeout; kill it
    nov 27 15:52:19 Arch-AcerTM4500 systemd-udevd[136]: seq 1138 '/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/ACPI0001:00/ACPI0002:00' killed
    nov 27 15:52:19 Arch-AcerTM4500 systemd-udevd[136]: worker [145] /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:09/PNP0C09:00/ACPI0001:00/ACPI0002:00 timeout; kill it
    nov 27 15:52:19 Arch-AcerTM4500 systemd-udevd[136]: seq 1060 '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:09/PNP0C09:00/ACPI0001:00/ACPI0002:00' killed
    Sorry for my strange sentences, i didn't speak or write English a long time ago.
    Last edited by vs22 (2015-02-13 09:13:17)

    I don't know why, but now it works.
    Possible reasons:
    previously I installed my system from bootstrap and now from the iso
    Arch updates
    Now I use journaling in ext4 previously not (I've installed both time to usb flash)

  • Each time I try to synch photos from my Windows 7 PC to my iPad2, iTunes stops working, and the error report says Problem Event Name:     APPCRASH   Application Name:     iTunes.exe   Application Version:     10.3.1.55   Application Timestamp:     4deec35

    Each time I try to synch photos from my Windows7 PC to my iPad2, iTunes stops working and the error message is:
    Problem Event Name:                          APPCRASH
      Application Name:                             iTunes.exe
      Application Version:                           10.3.1.55
      Application Timestamp:                    4deec351
      Fault Module Name:                          ntdll.dll
      Fault Module Version:                        6.1.7601.17514
      Fault Module Timestamp:                 4ce7ba58
      Exception Code:                                  c0000005
      Exception Offset:                                0002e3fb
      OS Version:                                          6.1.7601.2.1.0.768.3
      Locale ID:                                             1033
      Additional Information 1:                  0a9e
      Additional Information 2:                  0a9e372d3b4ad19135b953a78882e789
      Additional Information 3:                  0a9e
      Additional Information 4:                  0a9e372d3b4ad19135b953a78882e789
    I reloaded iTunes 10 (64 bit) successfully, but the problem remains the same.
    Any suggestions?

    I looked in the folder from which I want to synch photos, but there is no such thing as an "ipod photo cache" in that folder, or sub-folders, as suggested in the link which you were nice enough to provide.
    I have also tried removing photos from my iPad2 Photos App, and "iTunes has stopped working" shows up  again as soon as I click on the "Synch photos from" button.

  • Trying to start itunes - message appears "APSDAEMON.EXE MSVCR80.DLL is missing.  Then another box indicates "Error 7 (Windows error 126).  Itunes will not start.  Can someone tell me what the problem is and how to fix?

    when I tried to update to the new version of Itunes - message box appears "APSDAEMON.EXE MSVCR80.DLL is missing".  Then another box indicates "Error 7 (Windows error 126)".  Itunes will not start.  Can someone tell me what the problem is and how to fix?

    Solving the iTunes Installation Problems in Windows
    1. Apple has posted their solution here: iTunes 11.1.4 for Windows- Unable to install or open - MSVCR80 issue.
    2. If the Apple article does not fully resolve the problem for you, then try Troubleshooting issues with iTunes for Windows updates - MSVCR80.

  • I'm trying to download an episode of Dr. Who but it keeps telling me it's going to take 24 hours, and then it crashes and says "there was a problem downloading an unknown error occurred 50.  Any Ideas on how to fix it?

    I'm trying to download an epsiode of Dr. Who, but the download is saying it will take 24 hours, and then it stops and says "there was a problem downloading; an unknown error occured (50).  How can I fix this?  I don't think it's my internet, it's really pretty fast. 
    Thanks! 

    Try fixing up the validation issues...
    http://www.feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.stereogol.com%2Faudi o%2Fwimpy_podcast.php
    Not promising it will help, but it's worth a shot.

  • Problems installing and starting on Windows 7 64bit. error message - The file "i Tunes Library.itl" cannot be read because it was created by a newer version of iTunes.

    Hi I'm having problems installing and starting itunes program on Windows 7 64bit. After install the following error message is flagged - The file "i Tunes Library.itl" cannot be read because it was created by a newer version of iTunes. Would really appreciate any pointers!

    Never mind sorted it out lol. Somebody did a system restore of a week or so. I had done the update during that time and it was lost. Just redownloaded itunes from the internet and its working fine now.

  • I am having problems with my outlook 2011. While i am able to check and SEND email on all my other devices ( Ipad, iphone, Macbook), I am unable to do so with my iMac. This problem started suddenly and the error message i get is error 5.7.8. Please Help

    I  am having problems with my outlook 2011. While i am able to check and SEND email on all my other devices ( Ipad, iphone, Macbook), I am unablesend any email with my iMac ( i can recieve email) . This problem started suddenly and the error message i get is error 5.7.8. I have read the threads on line and went into settings, even created a new profile, nothing helps...Please advice..is this something to do with my keychain Access?

    As Outlook is not an Apple product, you will find more helpers familiar with Outlook here:
    Office for Mac forums

  • TS3212 I have a new computer, a HP with windows 8. I try to install itunes and get error. Says the installer has encountered an enexpected error installing thics package. This may indicate a problem with the package. The error code is 2503.

    I'm having problems installing Itines on my new computer with Windows 8. I always get problem with install. the error code is 2503. How do I correct this?

    Although you're getting a different error message, perhaps try the procedure from the following user tip:
    "The administrator has set policies to prevent this installation" error messages when installing iTunes for Windows on Windows Vista and Windows 7 systems

  • I have a Power Mac G4. I have previously burned DVDs with no problem.  Now I get an error message stating it doesn't recognize the disc and an error

    I have a Power Mac G4 with OX 10.4.11.  I have previously burned DVDs with no problem.  Now I've gotten two different sets of messages.  One states that
    the disc is not readable and an error code: 0x8002006D.  The more recent message states the disc is incompatible and an error code: 0x80020025.
    What is going on?  I need to burn discs immediately for a conference next week.

    "The more recent message states the disc is incompatible and an error code: 0x80020025."
    The error (0x80020025) refers to an unsupported drive (not disk).  I've read about relaunching the Finder to correct the problem.  Choose "Force Quit" from the Apple Menu and then choose "Finder." Click "Relaunch" and see if the drive still produces the error.  If there's no change, I'd be tempted to replace the drive.

  • I have been having this problem since the fourth of this month. I tried to open iTunes and this error came up: "iTunes was not installed correctly. Please reinstall iTunes error 7 windows error 126". If anyone can help I would greatly appreciate it.

    I have been having this problem since the 4th of this month. I tried to open iTunes and this error message came up: "iTunes was not installed correctly. Please reinstall iTunes error 7 windows error 126". There is nothing else that comes up but if anyone can help or know anything about it I will greatly appreciate it.

    Have you tried google for this Error Message...
    http://support.microsoft.com/kb/959077

  • Problems downloading and installing OS X Yosemite An error occurred while running scripts from the package

    Hi! I have problems downloading and installing OS X Yosemite.
    While downloading this message pops up:
    An error occurred while running scripts from the package \U201cwct8079783343594854923.pkg\U201d.
    and in /var/log/install.log i can see:
    MacBook-Pro installd[1086]: PackageKit: Install Failed: PKG: pre-install scripts for "com.apple.pkg.InstallMacOSX"\nError Domain=PKInstallErrorDomain Code=112 UserInfo=0x100193c00 "An error occurred while running scripts from the package “wct8079783343594854923.pkg”." {\n    NSFilePath = preinstall;\n    NSLocalizedDescription = "An error occurred while running scripts from the package \U201cwct8079783343594854923.pkg\U201d.";\n    NSURL = "#InstallMacOSX.pkg -- file://localhost/Users/username/Library/Application%20Support/AppStore/91504108 2/wct8079783343594854923.pkg#Distribution";\n    PKInstallPackageIdentifier = "com.apple.pkg.InstallMacOSX";\n}
    does anyone have an idea about this?
    thank you very much

    Mucked up installation. If the installer app is still in /Applications, delete it and start over.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10.2), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • I can't open my iPod Touch - tried the restore message and then error mewssage 3014 - iOS problems???

    I can't open my iPod Touch - tried the restore message and then error mewssage 3014 - iOS problems???

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • I downloaded the latest version and I get this error when I open it. Problem signature:   Problem Event Name:     InPageError   Error Status Code:     c0000185   Faulting Media Type:     00000003   OS Version:     6.1.7601.2.1.0.768.3. Any clue why or how

    I downloaded the latest version and I get this error when I open it. Problem signature:   Problem Event Name:
    InPageError   Error Status Code:
    c0000185   Faulting Media Type:
    00000003   OS Version:
    6.1.7601.2.1.0.768.3. Any clue why or how to fix?

    InPageError
    That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
    XP instructions in the following document: How to perform disk error checking in Windows XP
    Vista instructions in the following document: Check your hard disk for errors
    Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
    Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
    Does the chkdsk find/repair any damage? If so, can you get itunes to launch properly afterwards?

  • Tried to access programs and get Error: 16 message. What's the problem? Please help!

    Tried to access programs and get Error: 16 message. What's the problem? Please help! Photoshop, photoshop elements, Dreamweaver - none of my Creative Cloud apps will start-up, since my last update. I need to access these programs for jobs I'm working on.

    Hi wdriver,
    It seems like due to some unknown reason permission from the Licensing folder is removed. Please try launching any of the apps by right clicking and select Run as an Administrator, it should fix the issue by doing that.
    Please let us know if it helps.
    Regards,
    Abhijit

  • I keep losing entire catalogs. I put in 30,000 images and cannot get to them. Put in 3,000 images and get error message "LR encountered error when reading its previous cash and needs to quit. LR will fix this problem the next time it loads.' I  have loade

    I keep losing entire catalogs. I put in 30,000 images and cannot get to them. Put in 3,000 images and get error message "Light room encountered error when reading its previous cash and needs to quit. light room will fix this problem the next time it loads.'
    I  have loaded light room several times and even exited computer for 8 hours. Still get error message

    A search of this forum shows lots of threads where this issue of "error reading cache" is solved

Maybe you are looking for

  • Created by in Monitor shopping cart requires employee numer since SRM 5.0

    Hello experts, We have upgraded from SRM 4.0 to SRM 5.0 SRM SRM server 550. In monitor shopping cart using 'created by' to search shopping carts, users could usually enter their username. After the upgrade however users need to enter their empoyee nu

  • Strikethrough option in Form

    Dear all, I am trying to create a form with an option to strike through either one the words "Yes" or "NO" as shown below". I cannot find anyway to do so, but I do see some forms download from the internet can do it. Please help. Q1. Are you a xxxx?.

  • Email password

    Increasingly over the past weekor so my email client (Mac Mail) and my wife's email client (Windows Outlook) have started asking for our email passwords to be entered in order to send emails.  Sometimes this has to be repeated for twenty or thirty ti

  • How do import a playlist with my the songs in it to my second computer?

    I just recently bought an external harddrive for my 2 HP computers. I run Itunes on both. I decided i didnt want the one computer accessing the other through the network for the music as it has been a pain sometimes. My question is this. I have loade

  • Best practice on storing the .as and .mxml files

    I have some custom components, and they use their own .as action script files. The custom components are placed in the "src/component" folder right now. Should I place the associated .as files in the same "src/component" folder? What is the suggested