Chilkat Forum

Programming Languages / Environments => Java => Topic started by: Chilkat on December 20, 2017, 08:02:37 AM

Title: UnsatisfiedLinkError: libchilkat.so already loaded in another classloader
Post by: Chilkat on December 20, 2017, 08:02:37 AM
public class XMPMetaData {
I have a Java web application using Liferay, and the following code results in the error: 
Code: [Select]
Native code library failed to load.
java.lang.UnsatisfiedLinkError: Native Library /home/liferay/chilkatjava-9.5.0-jdk7-x86_64-linux/libchilkat.so already loaded in another classloader

This is the code to load the library:
Code: [Select]
static {
try {
    System.load("/home/chilkatjava-9.5.0-jdk7-x86_64-linux/libchilkat.so");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
    }
}
Title: Re: UnsatisfiedLinkError: libchilkat.so already loaded in another classloader
Post by: Chilkat on December 20, 2017, 08:04:54 AM
For errors such as this, one should Google/Bing/DuckDuckGo the error message, minus the specifies such as your directory path. 

For example, paste "java.lang.UnsatisfiedLinkError already loaded in another classloader" into the Google search bar.

In this case, the 1st result may offer a solution:  https://stackoverflow.com/questions/36936948/java-lang-unsatisfiedlinkerror-native-library-xxx-so-already-loaded-in-another