Author Topic: UnsatisfiedLinkError: libchilkat.so already loaded in another classloader  (Read 743 times)

Chilkat

  • Administrator
  • Full Member
  • *****
  • Posts: 103
  • Karma: +6/-0
    • View Profile
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);
    }
}

Chilkat

  • Administrator
  • Full Member
  • *****
  • Posts: 103
  • Karma: +6/-0
    • View Profile
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