Wednesday, October 19, 2011

java & tuxedo @@

Was facing issue where my java program failed to load the so library from Tuxedo8.

Spent quite much time. Finally solved it today. I am so happy!!! The feeling is the same every time my article got published on newspaper!

I got to decompile the tuxedo.jar, which comes with tuxedo installer. From there i put in as many system out as possible for troubleshooting. The program actually stopped at the part where System.loadLibrary is being called. It failed to load a particular so file even tough physically the file is there.

I started to check if the bit version of java matches the one of so file. My machine is AIX6.1 and i got to know that AIX6.1 only supports 64bit kernel. Hence i decided to run my program using 64bit version5 java.

After running the program using 64bit java, i saw more meaningful error messages this time as compared to the previous non-informative messages. From there i got to know the SO file failed to load its dependencies.

So i started to look for the dependencies, and put them under the same directory where the major SO file is located.

Of course i also set the path of where my SO file is to the variable LIBPATH and also to the -Djava.library.path

That's it :) Of course before writing this down i actually have gone through so many researches and trial and errors. Gosh. Imagine how happy am i now! :)

Oh ya, i dropped the System.loadLibrary, instead i hard coded the path using System.load :)

Some helpful commands along the way of my troubleshooting process

1) java -d64 -version
2) nm -X64