3 Replies Latest reply on Oct 29, 2003 4:35 PM by Jon Barnett

    UnsatisifiedLinkError with system library

    jch_14_5 Newbie

      I am getting an java.lang.UnsatisifiedLinkError when i am trying to execute a method from a windows dll. I do not get the error when loading the library using System.loadLibrary("lib_name"), it happens when i try to execute it. The funny thing is - this works fine in tomcat. I would imagine if this were a security issue i would get a security exception when attempting to load the library. Any ideas?

        • 1. Re: UnsatisifiedLinkError with system library
          Jon Barnett Master

          Your JNI problem probably stems from the fact the dll does not reside in your library path. I'm a bit rusty with Windows JNI but I believe the dll needs to be somewhere specified by the PATH environment variable. You can get an idea of what is applicable for your JBoss environment by the following line in your Java code:

          Hope that helps.

          • 2. Re: UnsatisifiedLinkError with system library
            jch_14_5 Newbie

            thanks but my path is fine, as i mentioned this works running under tomcat and stand alone. The funny thing is that i when i call System.loadLibrary("libname") i get no exception. I only get an unsatisfied link error when i call a method on it. By the way i am not trying this from an ejb - just a regular java class.
            Thanks again for any ideas

            • 3. Re: UnsatisifiedLinkError with system library
              Jon Barnett Master

              Are there any dependencies on the dll? And did you print the library path just before you did the load or better, just before you make the method call? I would compare that with what you get in the standalone Tomcat to get an idea if there is any mangling occurring. Also, there have been observed to be problems with servlets/JSP executing native libraries under certain conditions. Have you tried System.Load providing a full path to the dll? Another suggestion has been to put the dll in Windows\System32\.

              Were there any other bits of information contained with the error? A stack trace might help. Do you get a sense of what caused the problem - I can not find dependent libraries? I can not find a file?