Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 15800 invoked from network); 7 Jul 2004 19:33:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Jul 2004 19:33:57 -0000 Received: (qmail 49511 invoked by uid 500); 7 Jul 2004 19:33:30 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 49458 invoked by uid 500); 7 Jul 2004 19:33:29 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 49444 invoked by uid 99); 7 Jul 2004 19:33:29 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [195.112.4.54] (HELO smtp.nildram.co.uk) (195.112.4.54) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 07 Jul 2004 12:33:29 -0700 Received: from [127.0.0.1] (tpsoft.gotadsl.co.uk [81.6.252.137]) by smtp.nildram.co.uk (Postfix) with ESMTP id B96F3254C75 for ; Wed, 7 Jul 2004 20:33:12 +0100 (BST) Message-ID: <40EC4FFD.7000102@penhey.net> Date: Wed, 07 Jul 2004 20:33:17 +0100 From: Tim Penhey User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: UnsatisfiedLinkError - JNI References: <644154DB-D048-11D8-A29A-000A9594787C@henryson.com> In-Reply-To: <644154DB-D048-11D8-A29A-000A9594787C@henryson.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Josef Henryson wrote: > Hi! > > I get an UnsatisfiedLinkError when trying to System.loadLibrary("foo") > from a class instantiated within a Servlet. The library libFoo.jnilib > is in a folder within java.library.path and the class loading it is > inside a JAR in $CATALINA_HOME/shared/lib. Beside the JNI library is a > native library libBar.dylib. > > I'm running Tomcat 5.0.25 on Mac OS X 10.3.4 > > Here's the exception: > > UnsatisfiedLinkError: > /Users/henryson/Library/Java/Extensions/libFoo.jnilib: > java.lang.UnsatisfiedLinkError: > /Users/henryson/Library/Java/Extensions/libFoo.jnilib: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1485) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > at java.lang.System.loadLibrary(System.java:834) > > I have tried loading the library from a small Java application outside > the Tomcat server and it works fine when all classes/libraries are > within the same folder. > > Of course I have searched for a solution on Google and I have also > search old entries on this list (in an archive on a website) but there > just don't seem to be a solution available out there... =( > > Anyone that have a clue? I would be VERY thankful =) > > Regards, > > Josef Henryson > Well given the fact that the JNI library works fine when in a stand alone environment, it sounds like a load path problem. I'm not sure what OS X uses, but on unix it is the LD_LIBRARY_PATH, or on Windows the PATH. Try and get the code to output the environment before it does the load library call and make sure that the locations for all the dependant libraries are there. Hope that helps, Tim --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org