vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a standalone oc4j (10g) installation on Solaris 9 and when I run my servlet (which instantiates another class that uses native code), I get an java.lang.UnsatisfiedLinkError even though the native library is on the path specified when running the oc4j instance using (-Djava.library.path= ...) When the System.loadLibrary() fails on the native library, I print out the java.library.path and it is as expected and contains the native library but the error says: ld.so.1 java fatal mylibrary.so open failed No such file or directory If I remove the app server from my environment and test it using an "equivalent" scenario of just calling it from a java client program from the command line (instead of a web client) then it works (i.e., the native library is loaded etc). So in this case the classloader/nativeloader did not complain about this (very same) library. What could be the difference when the native library is getting loaded as part of the oc4j/web app versus when I run a simple java client program from the command line? Thanks p.s. I have set up the same oc4j/app on Windows and it works fine there. |
| ||||
| tintincat1977@yahoo.com wrote: > I have a standalone oc4j (10g) installation on Solaris 9 and when I run > my servlet (which instantiates another class that uses native code), I > get an java.lang.UnsatisfiedLinkError even though the native library is > on the path specified when running the oc4j instance using > (-Djava.library.path= ...) > > When the System.loadLibrary() fails on the native library, I print out > the java.library.path and it is as expected and contains the native > library but the error says: > ld.so.1 java fatal mylibrary.so open failed No such file or directory > > If I remove the app server from my environment and test it using an > "equivalent" scenario of just calling it from a java client program > from the command line (instead of a web client) then it works (i.e., > the native library is loaded etc). So in this case the > classloader/nativeloader did not complain about this (very same) > library. > > What could be the difference when the native library is getting loaded > as part of the oc4j/web app versus when I run a simple java client > program from the command line? One thing that I can think of is that mylibrary.so depends on another shared library that cannot be found. What does 'ldd mylibrary.so' tell you? I noticed, but did not investigate, that Java does use the whole shared library lookup path on Linux: the ld.so.conf mechanism seems not to apply to Java. Yours, Laurenz Albe |
| Thread Tools | |
| Display Modes | |
|
|