1 Reply Latest reply on Sep 10, 2002 6:31 PM by salkin

    Where to put JNI libraries for 3.0.2 - classloader issue

    salkin

      Hi-

      I have a 3rd party jar file that is a JNI wrapper for a windows DLL. In 3.0.0 I placed this jar file in default/lib and was able to use it. In 3.0.2 this no longer works - I can see the jar file loaded in boot.log, but the class is not available to running apps. So I moved the jar file into my applications ear file lib directory. It works there on the first call, but subsequent users logging in trying to use it get an error. The first error is "java.lang.UnsatisfiedLinkError: Native Library C:\WINNT\system32\XXXX.dll already loaded in another classloader" and subsequently a NoClassDefFoundError occurs on attempts to access the wrapper class.

      Any ideas on this? Thanks in advance.

        • 1. Re: Where to put JNI libraries for 3.0.2 - classloader issue
          salkin

          Updated info:

          The above happened this morning on a live site (we had moved to 3.0.2 because of an issue with Jetty and certs in 3.0.0) but after restarting hasn't happened again. OTOH there has been very light load this afternoon, I mean in the range of 2-3 external users all afternoon. Right now it's being used as a demo tool by some salepeople and that's all - no paying customers yet.

          So since it hasn't happened again, maybe it's a one-time fluke, but I'm very suspicious. It seems like something that could happen if one classloader in one thread loaded the DLL and then another one wanted to also. But maybe we haven't needed two simultaneous threads since the first crash.

          In any event, I'd really like to be able to move the JNI jar back to default/lib if only it would be loaded from there.

          TIA again,

          S-