MuleSoft · SAP Connector
JCo initialization failed: Native Library already loaded in another classloader
This SAP Connector error means the JCo native library is loaded twice, usually because a copy sits in the same directory as the JCo JARs. Remove the duplicate native library from the JAR directory, or put it on LD_LIBRARY_PATH and share it across apps.
VerifiedLast verified
01Error text
java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.UnsatisfiedLinkError: Native Library ... already loaded in another classloader02Likely causes
- Loading the native library from the global configuration copies it into the app, but leaves the source. If the source is in the same directory as the JCo JARs, the library is loaded twice.
03How to fix it
- Remove the duplicate native library from the JAR directory (the simplest option).
- Or set
LD_LIBRARY_PATHto the folder holding the native library and share it across apps, which MuleSoft calls best practice.
04Fix it with AI
Copy this prompt into Claude Code, ChatGPT or any AI assistant. It already holds the error, the likely causes and the fix steps, so the assistant starts from what is known instead of guessing.
I'm getting this error in MuleSoft Anypoint (SAP Connector):
java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.UnsatisfiedLinkError: Native Library ... already loaded in another classloader
What it usually means: This SAP Connector error means the JCo native library is loaded twice, usually because a copy sits in the same directory as the JCo JARs. Remove the duplicate native library from the JAR directory, or put it on LD_LIBRARY_PATH and share it across apps.
Likely causes:
- Loading the native library from the global configuration copies it into the app, but leaves the source. If the source is in the same directory as the JCo JARs, the library is loaded twice.
Fix steps that usually work:
1. Remove the duplicate native library from the JAR directory (the simplest option).
2. Or set LD_LIBRARY_PATH to the folder holding the native library and share it across apps, which MuleSoft calls best practice.
Help me fix it. If you can read my project files, find where this error comes from. If not, ask me for what you need (the failing step, its input, the connection or config). Check the likely causes one by one, tell me which one it is and why, then give me the exact change to make. Do not change anything in production. Reference: https://ipaaserrors.com/mulesoft/sap-native-library-already-loaded-in-another-classloaderNothing is sent anywhere from this page. Read what the assistant suggests before you apply it.
05Official documentation
→Related errors
- Native library sapjco3 is too oldThis SAP Connector error means the sapjco3 native library does not match the SAP JCo JAR, most often because they come from different JCo packages. Use sapjco3.jar and the sapjco3 native file from the same JCo package, with the same 32-bit or 64-bit build as the JVM.
- Illegal JCo archive: It is not allowed to rename or repackage the original archive sapjco3.jarThis SAP Connector error means the JCo 3.0.11 or later JAR was renamed, which JCo does not allow; the IDoc library has the same rule. Add the maven-shade-plugin to pom.xml with sapjco3 and sapidoc3 includes.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for MuleSoft work:Open MuleSoft jobsMuleSoft pay estimates