Skip to content
Advertisement

Unable to load library (libFile.so) on jboss server on redhat linux

I am getting the unsatisfied link error when I try to run the web-app.

JavaScript
  1. I have created the function which loads the native library stored at “/home/libraryFiles”, using JNA.
  2. I have stored all of my libXXXX.so files at “/home/libraryFiles”.
  3. I have exporting my war file from eclipse in windows and deploying it on the jboss server on redhat linux.

This is my function :

JavaScript

}

I am mapping url through rest controller to execute

JavaScript

I have also tried setting jna.library.path & java.library.path to “home/libraryFiles”, but of no use. (using system.setProperty()) I also tried set $LD_LIBRARY_PATH=home/libraryFiles but still no good.

Seems like my web-app is not able to point out of the default resource path “/opt/jboss-eap-7.3/jboss-modules.jar”

Any help is welcoming.

PS : I tried the same function/code on my windows PC, its working fine. I don’t know why its not working on redhat linux.

Thanks in Advance.

Advertisement

Answer

The addSearchPath() method is specific to a library, and the additional path(s) are stored in a map with the library name as the key.

The loadLibrary() method checks that map using the library name.

You have used differing strings as the key to store the path and retrieve it:

JavaScript

You should either change “libXXXX” to “XXXX” in the first line (probably the preferred style) or do the reverse in the second line to match.

As noted in the comments, you also must be careful with relative vs. absolute file paths and directory permissions.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement