Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4748750

UnsatisfiedLinkError exception throws when load native DLL second time via jni

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.1
    • deploy
    • x86
    • windows_2000


      ###@###.### 2002-09-17

      J2SE Version (please include all output from java -version flag):
       java version "1.4.1-rc"
       Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19)
       Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)

      Operating System Configuration Information (be specific):
       Win2K

      Bug Description:
       Having a problem with an applet that loads a native dll second time via
       jni. The first time the applet's init() method is called the dll is loaded as
       expected and the applet is operational. Then the page that hosts the applet
       is unloaded and the applet is destroyed (that is, the applet's destroy() method
       is called). At this point we would expect to be able to load the applet again
       from another site. However, when we try to do this the VM throws the
       following exception:

         "c:\TEMP\\EtJniCapiLibrary.dll" java.lang.UnsatisfiedLinkError: Native
         Library C:\temp\\EtJniCapiLibrary.dll already loaded in another classloader

      Impact Statememt:
        With this problem, not be able to support CAPI applet and support Microsoft
        Digital IDS/ Smart Card support , when end users are using Sun Plugin as their
        JVM. Customer would really like to add this support, otherwise today they will
        be resrticted to supporting this only when using IE with MS JVM , and not
        solution in Windows XP as IE does not have a JVM and MS has pulled the JVM
        dowload from their site.

      Steps to Reproduce (be specific):

        1) Edit the hosts file (c:\winnt\system32\drivers\etc\hosts) to include the
           following entry:

        216.191.252.73 libloadertest.entrust.com

           Basically by doing this from the machine on which you make the above
           modification , you are making libloadertest.entrust.com go to the same site
           as entinterop.entust.com. but to the browser and the JVM it would seem
           like a different site / code base from which it is downloading the applet.

      2) Open the browser and go to

           https://entinterop.entrust.com/TruePassSample/AuthenticateUserCapi.html.

         This is the page that downloads the CAPI applet to allow users to do login
         using a certificate in Microsoft CAPI store.

      3) You will get a "No CAPI profiles" error message because no CAPI profiles
         got issued to work with, but this error message is a valid one and indicates
         the applet got intialized and loaded fine and trying to find a CAPI profile
         to use to authenticate to the site.

      4) Keep the browser open and go to
         https://libloadertest.entrust.com/TruePassSample/AuthenticateUserCapi.html.

         (go to antoher site in the same browser session and download the same CAPI
          applet jar file)

      5) You will see a different error message at Java Console where it fails to
         load the EtJniCAPIlibrary.dll when go to the second site in the same
         browser session, from where the CAPI applet gets downloaded:

         EntrustTruePassApplet/6.0] [EMERGENCY] Could not load CAPI DLL at
         "C:\TEMP\TP-9CC33DE5-34F8-4011-941C-FCE386F21310-600499\EtJniCapiLibrary.dll
         " java.lang.UnsatisfiedLinkError: Native Library
         C:\temp\TP-9CC33DE5-34F8-4011-941C-FCE386F21310-600499\EtJniCapiLibrary.dll
         already loaded in another classloader

      This is a big problem for the customer and they would like have it fixed
      in 1.4.2. In their case, they want site A [www.portal.com] as portal , and site
      B/site C say www.financeportal.com, www.hrportal.com to participate in
      single sigon/authentication to the portal website and use their sign/encrypt
      features from the applet. But if users are using CAPI/Smart Card digital
      identities, it can not be done when they are using Sun Plugin JVM in their
      browser.

      Attached Java Console log file with trace level set to 5. (capi_native_dll_error.txt)

            xlu Xiaobin Lu (Inactive)
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: