This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Re: java.lang.UnsatisfiedLinkError on Linux
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2012
02:50 AM
java.lang.UnsatisfiedLinkError on Linux
Hi all,
I've the following problem:
Install my application on SUSE Linux Enterprise Server 11 Service Pack 1 Version 11.1.1.1 with x86_64 architecture and jre 1.6 64 bit. At the end of the installation (post-installation) a custom code action is launched with my java class that invokes a c library (.so) through JNI.
This library depends on another library and both of them are installed in installation phase in a lib directory. The LD_LIBRARY_PATH is correctly set to this lib directory before installation.
The error I get is:
class myClassAction.install() Unexpected Fatal Error:
java.lang.UnsatisfiedLinkError: /mypath/lib/libTwo.so: libOne.so: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
...
I replaced the lib names with libOne.so and libTwo.so.
ldd on libTwo returns the referenc to libOne.so at the correct path.
Another strange thing is: if I create the lib directory (empty) before the installation, all works correctly.
Any idea?
Thanks
Gennaro
I've the following problem:
Install my application on SUSE Linux Enterprise Server 11 Service Pack 1 Version 11.1.1.1 with x86_64 architecture and jre 1.6 64 bit. At the end of the installation (post-installation) a custom code action is launched with my java class that invokes a c library (.so) through JNI.
This library depends on another library and both of them are installed in installation phase in a lib directory. The LD_LIBRARY_PATH is correctly set to this lib directory before installation.
The error I get is:
class myClassAction.install() Unexpected Fatal Error:
java.lang.UnsatisfiedLinkError: /mypath/lib/libTwo.so: libOne.so: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
...
I replaced the lib names with libOne.so and libTwo.so.
ldd on libTwo returns the referenc to libOne.so at the correct path.
Another strange thing is: if I create the lib directory (empty) before the installation, all works correctly.
Any idea?
Thanks
Gennaro
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2012
04:32 AM
Update: on SUSE Linux 10 it works correctly! Do you think it is an IA2011 issue or does it depend on c libraries?
Here it is the difference between the two servers:
IT DOESN'T WORK
>cat /etc/*-release
LSB_VERSION="core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64"
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 1
IT WORKS
>cat /etc/*-release
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64"
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 2
Here it is the difference between the two servers:
IT DOESN'T WORK
>cat /etc/*-release
LSB_VERSION="core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64"
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 1
IT WORKS
>cat /etc/*-release
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64"
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 2
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2012
11:11 AM
Is you library 32 or 64 bit?
Try "file /mypath/lib/libOne.so" command.
Then if it is 32 bit I guess you ran on an incompatibility issue and need to recompile...
If it is not your issue .... I have no more ideas 😉
--Jerome
Try "file /mypath/lib/libOne.so" command.
Then if it is 32 bit I guess you ran on an incompatibility issue and need to recompile...
If it is not your issue .... I have no more ideas 😉
--Jerome
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 05, 2012
03:18 AM
I already verified, both of them are 64 bit 😞
libOne.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
libTwo.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
I'm going crazy!
libOne.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
libTwo.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
I'm going crazy!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 05, 2012
03:41 AM
genleo wrote:
I already verified, both of them are 64 bit 😞
libOne.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
libTwo.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
I'm going crazy!
=>The LD_LIBRARY_PATH is correctly set to this lib directory before installation.
I would suggest you to add some debug info to your installer to check that LD_LIBRARY_PATH really contains your lib folder just before calling your custom code. Maybe something is preventing setting this variable if "lib" folder does not already exist?