Shared JNI library (.so) in Tomcat - UnsatisfiedLinkError
<p>I have a JNI library (.so) shared between two web applications deployed in Tomcat7. I am loading the library using the System.loadLibrary only once in the first web application that is being deployed and then in the second I'm checking if it already was loaded to not load anymore (I tried loading it in both and I got UnsatisfiedLinkError - library was loaded by another classloader). I can make any call to the native library in the first application, but in the second one I get UnsatisfiedLinkError with the method name that I am trying to call. </p>

<p>I am running out of ideas of what I can do. Any ideas? I tried most of the solutions on SO.
Thank you.</p>

<p><strong>EDIT</strong>
Yes, I tried adding the library in the tomcat lib folder and loading it from there. Initially it was in the bin folder and the same issue occurs.</p>