11 Replies Latest reply: Feb 27, 2013 11:48 AM by 874054 RSS

    UnsatisfiedLinkError : JNLP + Applet + Native DLL

    985055
      Hi,

      I have created a JNLP to load the applet and some native DLL files. Following are the codes of each components


      JNLP
      ==================================================


      <?xml version="1.0" encoding="UTF-8"?>
      <!-- href attribute contains relative path;
      codebase attribute not specified -->
      <jnlp href="myKad.jnlp">
      <information>
      <title>MyKad Reader Applet</title>
      <vendor>MyKad</vendor>
      </information>
      <security>
      <all-permissions/>
      </security>
      <resources>
      <!-- Application Resources -->
      <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" />
      <jar href="HLB_Mykad-0.0.1-SNAPSHOT.jar" main="true"/>
      <nativelib href="HLB_Mykad-0.0.1-SNAPSHOT.jar" download="eager"/>
      </resources>
      <applet-desc name="MyKad Applet" main-class="com.glexim.applet.GleximApplet" width="1" height="1">
      </applet-desc>
      <update check="background"/>
      </jnlp>


      JAR (HLB_Mykad-0.0.1-SNAPSHOT.jar) Structure (JAR's are Packaged at top lavel)
      ==================================================

      com.glexim.applet.GleximApplet
      META-INF
      Sample.dll
      DermalogPLS1.dll
      DermalogVC3.dll

      HTML Code
      ==================================================
      <applet jnlp_href="./applet/myKad.jnlp"
      code="com.glexim.applet.GleximApplet" id="gleximApplet"
      mayscript="true" width="0px" style="border: 0px" />


      While loading applet I am getting following exception in applet console:
      ==================================================

      java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: no Sample in java.library.path
           at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
           at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.UnsatisfiedLinkError: no Sample in java.library.path
           at java.lang.ClassLoader.loadLibrary(Unknown Source)
           at java.lang.Runtime.loadLibrary0(Unknown Source)
           at java.lang.System.loadLibrary(Unknown Source)
           at com.glexim.zf1.MyKad$1.run(MyKad.java:19)
           at java.security.AccessController.doPrivileged(Native Method)
           at com.glexim.zf1.MyKad.<clinit>(MyKad.java:13)
           at com.glexim.applet.GleximApplet.<init>(GleximApplet.java:43)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
           at java.lang.reflect.Constructor.newInstance(Unknown Source)
           at java.lang.Class.newInstance0(Unknown Source)
           at java.lang.Class.newInstance(Unknown Source)
           at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
           at java.awt.event.InvocationEvent.dispatch(Unknown Source)
           at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
           at java.awt.EventQueue.access$400(Unknown Source)
           at java.awt.EventQueue$2.run(Unknown Source)
           at java.awt.EventQueue$2.run(Unknown Source)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
           at java.awt.EventQueue.dispatchEvent(Unknown Source)
           at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
           at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
           at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
           at java.awt.EventDispatchThread.run(Unknown Source)
      Exception: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: no Sample in java.library.path

      Edited by: 982052 on Jan 21, 2013 11:08 AM

      Edited by: 982052 on Jan 21, 2013 11:09 AM