tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Hirner" <andr...@projektinter.net>
Subject Re: how do I load a native library?
Date Mon, 24 Jun 2002 17:32:31 GMT
Hi

> Unless I am missing something, it looks like it should work.
> is "mapscript" the name of your dll?
I am working on Linux, so the shared library is called libmapscript.so

> Is "mapscript.dll" in your PATH?
as far as I am concerned the path to shared libraries is set in the
LD_LIBRARY_PATH variable and this is what I did. If I inculde the
static block listed in script below in a servlet and call the native
methods it works. That's why I think that the mistake has something to
do with way I call library in the InetMapserver class.

Thanks Andreas


> Hi,
>
> I would like to load a native library for all applications in the
> common/lib directory.
> So I wrote the following code:
>
>  public class InitMapserver
>  {
>    static
>   {
>      try {
>         System.loadLibrary("mapscript");
>         System.err.println("libmapscript.so loaded");
>      } catch (UnsatisfiedLinkError e) {
>         System.err.println("libmapscript.so not loaded: " + e);
>      }
>    }
>  }
>
> then I created a jar file and copied it into the common/lib
directory.
> After restarting tomcat, I called the class in a servlet using the
> Class.forName method. Unfortunately this does not work.
>
> What did I wrong?
>
> Thanks Andreas
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>
>
>
>



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message