UnsatisfiedLinkError with Java1.6 in AIX6.1

Hi Folks,

I'm facing the below error when loading my library on AIX6.1

java.lang.UnsatisfiedLinkError: marimba (A file or directory in the path name do
es not exist.)
        at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1013)
        at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:977
)
        at java.lang.System.loadLibrary(System.java:470)
        at com.marimba.desktop.FileSystem.loadLibrary(FileSystem.java:52)
        at com.marimba.desktop.UnixDesktop.init(UnixDesktop.java:169)
        at com.marimba.desktop.Desktop.getDesktop(Desktop.java:1803)
        at com.marimba.apps.tuner.Tuner.main(Tuner.java:5917)

Java Version used is 1.6
The .so file is of 64-bit version.Below command confirms this

bash-4.0# file libmarimba.so
libmarimba.so: 64-bit XCOFF executable or object module not stripped

I tried setting all variables, java.library.path, LIBPATH, LD_LIB_PATH and JVM_LIB_DIR to include the path of my library

Also even a sample java program with only a single line,

System.load("/opt/QIP_EndPoint/Tuner/lib/libmarimba.so");

fails to load the library with java1.6 But the same sample program loads it with java 1.5

I also see more changes in jre/bin folder of IBM's java1.6 like libjava.a and few other files missing

Could anyone please help me with how this library can be loaded.

Regards,
Bharath M

Just a guess: have you checked the filemode of the library? To access it you must be able to read it ("r--"-flag) and probably to execute it ("--x"-flag). You also need to have r-x for the directory in which the file is located.

If you are unsure: post the output of "ls -l /path/to/libmarimba.so", of "ls -ld /path/to" and the output of "id".

I hope this helps.

bakunin

Hi Bakunin,

Thanks for your reply...

I have also tried changing the file permissions of the file by using "chmod 777 libmarimba.so" command...

Still it dint work..

Below are the results of commands you have asked to execute,

bash-4.0# ls -l libmarimba.so
-rwxrwxrwx    1 root     system        45889 10 May 20:30 libmarimba.so
bash-4.0# ls -ld libmarimba.so
-rwxrwxrwx    1 root     system        45889 10 May 20:30 libmarimba.so

Could you please help me understand what's going wrong...

Regards,
Bharath M

Sorry, i think we have a misunderstanding here: i asked you to check the permissions of the file itself (which you did) and the directory where it resides. I admit that the permissions of the file itself should not prevent its usage even if they are a bit dangerous (everybody could change this file, which isn't a good idea - change the permissions to "755", removing write-access for world and the group).

As i do not know where your library resides, lets suppose it is "/somewhere/yourlib/libmarimba.so". You need to check the permissions of the file itself (which you did) and the permissions of the directory, where it resides:

ls -ld /somewhere/yourlib

I hope this helps.

bakunin

Hi Bakunin,

That was misunderstanding from my end. Please find below the output of commands you have asked for,

bash-4.0# ls -ld /opt/QIP_EndPoint/Tuner/lib
drwxr-x---   12 root     system         4096 30 May 20:34 /opt/QIP_EndPoint/Tuner/lib

bash-4.0# ls -l /opt/QIP_EndPoint/Tuner/lib/libmarimba.so
-rwxrwxrwx    1 root     system        45889 10 May 20:30 /opt/QIP_EndPoint/Tune
r/lib/libmarimba.so

Regards,
Bharath M

I have marked bold what is probably the culprit: issue the following (as user root):

chmod 755 /opt/QIP_EndPoint/Tuner/lib

and i suppose it will work. You may want to read about "filemodes" or "file permissions" in UNIX to understand the problem.

I hope this helps.

bakunin

Hi Bakunin,

I tried modifying the file permission on the folder level with 755 and 777 as well...

Still I'm getting this unsatisfiedLinkError...

Regards,
Bharath M

You said it worked with Java 1.5 in your first post. Have you tried deinstalling Jav completely and then reinstalling Java 1.6? IBMs Java package is a bit troublesome: when you try to find the java executable you find links pointing to links pointing to ... and eventually you find an executable. I found that it is quite easy to get things confused with the setting of a insuspicious-looking environment variable.

Otherwise i am at the end of my knowledge, sorry.

I hope this helps

bakunin