1 Reply Latest reply on Jun 26, 2008 3:47 PM by 666705

    Common JNI Native Library inside servlets

      I need to load a native library from a jee application, every things runs pretty well until I instanciate a new class inside a different application and try to load the same native library, wls throws a UnsatisfiedLinkException.
                How can I share the native library for both applications and avoid the UnsatisfiedLinkException?
                Any idea, thoughts?
        • 1. Re: Common JNI Native Library inside servlets
          Finally I get it working by myself. In difference to WAS, WLS does not have any document where specifies how to load a shared native library.
                    After two weeks of research, I went for an EJB solution followed by a singleton class. Why EJB? because I need to have an only one object where I can load the native library both loaded by the same classloader and share it by any mean. With this implementation avoid the UnsatisfiedLinkException, and publish an object which has access to the native library. And finally the singleton, you know how it works, it loads once the native library in its constructor avoids the restriction to load just once a native library in the same JVM.