AIX JNI Link with G++ module Problem

Discussion in 'Java' started by chriskr7, Jul 13, 2006.

  1. chriskr7

    chriskr7 Guest

    Hi, I changed C source to C++ source and compiled with g++.

    The output file is .so module which java source calls JNI native
    function in the

    source.

    However, when aix server restart and try to call native funtion, there
    is the error

    like this : java.lang.UnsatisfiedLinkError. and... when I try
    again, the error

    changes to java.lang.NoClassDefFoundError.

    My c++ source code are fully tested except for JNI related function
    calls.

    Is there something wrong with this jni part or :



    jint iPathSize = env->GetArrayLength(savepath);
    jint iNameSize = env->GetArrayLength(filename);
    jint iSourceSize = env->GetArrayLength(source);
    jbyte * aSavePath = env->GetByteArrayElements(savepath, 0);
    jbyte * aFileName = env->GetByteArrayElements(filename, 0);
    jbyte * aSource = env->GetByteArrayElements(source, 0);

    //....do some stuffs

    env->ReleaseByteArrayElements(savepath, aSavePath, 0);
    env->ReleaseByteArrayElements(filename, aFileName, 0);
    env->ReleaseByteArrayElements(source, aSource, 0);



    is there something I should set in java for using c++ jni function?

    please help me T.T any ideas?

    enviroment: AIX 5.1 gcc 4.0
     
    chriskr7, Jul 13, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike
    Replies:
    0
    Views:
    731
  2. Replies:
    2
    Views:
    1,833
  3. chriskr7
    Replies:
    1
    Views:
    423
    Victor Bazarov
    Jul 13, 2006
  4. ClownPleco

    putenv for AIX and ifdef for AIX

    ClownPleco, Aug 22, 2007, in forum: C Programming
    Replies:
    5
    Views:
    1,177
    Thomas Dickey
    Aug 24, 2007
  5. Replies:
    5
    Views:
    219
    Philippe Lucas
    Jul 8, 2005
Loading...

Share This Page