468,467 Members | 2,686 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,467 developers. It's quick & easy.

AIX JNI Link with G++ module Problem

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

Jul 13 '06 #1
1 1960
chriskr7 wrote:
[..]
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
Ask either in an AIX newsgroup or in Java newsgroup. This is not
a C++ language problem.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by thecrow | last post: by
3 posts views Thread by Fortepianissimo | last post: by
2 posts views Thread by faktujaa | last post: by
1 post views Thread by Ron | last post: by
2 posts views Thread by swartzbill2000 | last post: by
12 posts views Thread by rdemyan via AccessMonster.com | last post: by
8 posts views Thread by Neil | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.