You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Dr. Evil" <dr...@sidereal.kz> on 2002/01/07 21:37:07 UTC

JNI libs and Tomcat?

Hi, I'm trying to get Jmagick (a JNI interface for Imagemagick) to
work with my favorite web server, which is Tomcat 4.  In the release
notes, it says:

Applications that require native libraries must ensure that the
libraries have been loaded prior to use.  Typically, this is done with
a call like:
 
  static {
    System.loadLibrary("path-to-library-file");
  }

However, when I put in /usr/local/lib/libImagemagick.so in there, and
put it in a Listener that starts when the app starts, I get an error
that path separators are not allowed in the loadLibrary method.  I
tried putting that library in the $TOMCAT/lib directory, and taking
out the full path, and that didn't work.  Any sugestions?

Thanks!

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JNI libs and Tomcat?

Posted by Janek Bogucki <ja...@yahoo.co.uk>.
 --- "Dr. Evil" <dr...@sidereal.kz> wrote: > 
> Hi, I'm trying to get Jmagick (a JNI interface for
> Imagemagick) to
> work with my favorite web server, which is Tomcat 4.
>  In the release
> notes, it says:
> 
> Applications that require native libraries must
> ensure that the
> libraries have been loaded prior to use.  Typically,
> this is done with
> a call like:
>  
>   static {
>     System.loadLibrary("path-to-library-file");
>   }
> 
> However, when I put in
> /usr/local/lib/libImagemagick.so in there, and
> put it in a Listener that starts when the app
> starts, I get an error
> that path separators are not allowed in the
> loadLibrary method.  I
> tried putting that library in the $TOMCAT/lib
> directory, and taking
> out the full path, and that didn't work.  Any
> sugestions?
> 
> Thanks!
> 
> --

try System.load instead of System.loadLibrary.

   static {
     System.load("/usr/local/lib/libImagemagick.so");
   }


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JNI libs and Tomcat?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On 7 Jan 2002, Dr. Evil wrote:

> Date: 7 Jan 2002 20:37:07 -0000
> From: Dr. Evil <dr...@sidereal.kz>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: JNI libs and Tomcat?
>
>
> Hi, I'm trying to get Jmagick (a JNI interface for Imagemagick) to
> work with my favorite web server, which is Tomcat 4.  In the release
> notes, it says:
>
> Applications that require native libraries must ensure that the
> libraries have been loaded prior to use.  Typically, this is done with
> a call like:
>
>   static {
>     System.loadLibrary("path-to-library-file");
>   }
>
> However, when I put in /usr/local/lib/libImagemagick.so in there, and
> put it in a Listener that starts when the app starts, I get an error
> that path separators are not allowed in the loadLibrary method.  I
> tried putting that library in the $TOMCAT/lib directory, and taking
> out the full path, and that didn't work.  Any sugestions?
>

The rules inside Tomcat are the same as for JNI accessed libraries in
any Java application:

* The argument to loadLibrary() must be a *filename* not
  a *pathname*.

* The corresponding library file has to be on the PATH environment
  variable (not CLASSPATH).

> Thanks!
>

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>