title: java.lang.UnsatisfiedLinkError Native Library already loaded in another classloader during app reload in Tomcat8
body: <p>I have a Java Web application running in Tomcat8.
  I stored the native libraries in /bin folder of Tomcat installation.</p>
  
  <p>I load libraries with JNA using </p>
  
  <pre><code>Native.loadLibrary("myLib",MyLib.class);
  </code></pre>
  
  <p>This works without any problem, if I have to update or reload the application it works.</p>
  
  <p>My problem is a third-party library with its own native library.
  I stored it in the same /bin directory and it works, but when I reload the application Tomcat fails to load with this error:</p>
  
  <pre><code>java.lang.UnsatisfiedLinkError: Native Library ...already loaded in another classloader
  </code></pre>
  
  <p>If I restart tomcat service it works again. I found this problem only during the application reload.</p>
  
  <p>Decompiling the third-party library I found that its native library is loaded with this command:</p>
  
  <pre><code>System.loadLibrary("thirdpartylib");
  </code></pre>
  
  <p>How can I force this library load at tomcat level without a UnsatisfiedLinkError in case of application reload?</p>