0 Replies Latest reply: Sep 12, 2013 10:19 AM by Exspecto RSS

    JNLPClassLoader finds Native Libraries but wants to load them from "PATH" instead?




      I'm getting this odd behaviour with JNLP when running my applet.  My applet's jar file (CameraViewerApplet.jar) and resource jar file (CameraViewerAppletResources.jar - where native dlls are stored) are both signed.  My JNLP file specifies that native libraries are required (see JNLP file at bottom).  During the execution of the applet, Java Console logs indicate that the native libraries are successfully "found, loaded and stored locally" (see snippet below).  However a "java.lang.UnsatisfiedLinkError:" error occurs later on as my "MapleJNI.dll: Can't find dependent libraries".  Now, I've use Dependency Walker to see if any dependant dlls are missing but it indicates that all required and dependent dlls are found (in same location as the "MapleJNI.dll").  The only way I can get my applet to run successfully is to copy all the dlls in the windows\system32 folder (or any location in my Windows' PATH environment variable).  My question is as follows:  If my native libraries are found in the temporary folder created by the JNLP class loader (all other dlls are present as well), why is the applet still looking for the dlls in the Window's PATH?  Any suggestions on how to resolve this problem?




      basic: Applet loaded.

      basic: Applet resized and added to parent container

      basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 266279 us, pluginInit dt 695162908 us, TotalTime: 695429187 us

      basic: JNLP2ClassLoader.findClass: maple.MapleJNI: try again ..

      basic: JNLP2ClassLoader.findLibrary: Looking up native library: MapleJNI.dll

      cache: Looking up native library in: C:\Users\exspecto\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\2b56ba54-44989ad7-n\MapleJNI.dll

      basic: JNLP2ClassLoader.findLibrary: native library found: C:\Users\exspecto\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\2b56ba54-44989ad7-n\MapleJNI.dll

      java.lang.UnsatisfiedLinkError: C:\Users\exspecto\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\2b56ba54-44989ad7-n\MapleJNI.dll: Can't find dependent libraries

      at java.lang.ClassLoader$NativeLibrary.load(Native Method)

      at java.lang.ClassLoader.loadLibrary1(Unknown Source)

      at java.lang.ClassLoader.loadLibrary0(Unknown Source)

      at java.lang.ClassLoader.loadLibrary(Unknown Source)

      at java.lang.Runtime.loadLibrary0(Unknown Source)

      at java.lang.System.loadLibrary(Unknown Source)

      at maple.MapleJNI.<clinit>(MapleJNI.java:12)

      at CameraViewerApplet.init(CameraViewerApplet.java:31)

      JNLP FILE:


      <?xml version="1.0" encoding="UTF-8"?>

      <jnlp spec="6.0+" xmlns:jfx="http://javafx.com" codebase="" href="CameraViewerApplet.jnlp">



              <vendor>NetFore Systems</vendor>

              <description>SceneEye Application</description>

              <homepage href="http://localhost:8080/SceneEye" />







              <j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/>


          <resources os="Windows" arch="x86">

              <jar href="CameraViewerApplet.jar" main="true" download="eager"/>

              <nativelib href="CameraViewerAppletResources.jar"/>


          <resources os="Windows" arch="amd64">

              <jar href="CameraViewerApplet.jar" main="true" download="eager"/>

              <nativelib href="CameraViewerAppletResources.jar"/>






              height="488" />

          <update check="always"/>