You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mario Fernandez <mf...@sia.es> on 2002/02/14 21:09:33 UTC

Problem with JNI, Tomcat 4.0.1 and FreeBSD

> Hi everybody,
> 
> I´ve got an annoying error working with JNI and Tomcat 4.0.1 in a FreeBSD
> machine. I call a native method from a servlet and it doesn´t work. I get
> a core dumped... What do I have to do to make it works in Tomcat 4.0.1???
> My classes an native code are below:
> Is it necessary to do something in Tomcat to work with JNI??
> 
> From the servlet i make the following call:
> 
> ....
> 
> Library.list(null, 0);
> 
> ....
> 
> My class Library is like this:
> 
> public class Library{
> 
> static {
> 
> System.loadLibrary("mylib"); // The sahred library is called libmylib.so
> and this works fine
> }
> 
> public native static void list(String name, int num);
> 
> }
> 
> 
> The function header in Library.h (generated by javah -jni Library) is:
> 
> JNIEXPORT void JNICALL_Library_list(JNIEnv *,jobject,jobject,jint);
> 
> And I use this header in mylib.c
> 
> Thanks in advance
> 
> 

RE: Problem with JNI, Tomcat 4.0.1 and FreeBSD

Posted by Manish Bhatnagar <ma...@accord-soft.com>.
Where are you putting your mylib.so library? It should be in $CATALINA_HOME\lib.

-----Original Message-----
From: Mario Fernandez [mailto:mfernandez@sia.es]
Sent: Friday, February 15, 2002 1:40 AM
To: tomcat-user@jakarta.apache.org
Subject: Problem with JNI, Tomcat 4.0.1 and FreeBSD



> Hi everybody,
> 
> I´ve got an annoying error working with JNI and Tomcat 4.0.1 in a FreeBSD
> machine. I call a native method from a servlet and it doesn´t work. I get
> a core dumped... What do I have to do to make it works in Tomcat 4.0.1???
> My classes an native code are below:
> Is it necessary to do something in Tomcat to work with JNI??
> 
> From the servlet i make the following call:
> 
> ....
> 
> Library.list(null, 0);
> 
> ....
> 
> My class Library is like this:
> 
> public class Library{
> 
> static {
> 
> System.loadLibrary("mylib"); // The sahred library is called libmylib.so
> and this works fine
> }
> 
> public native static void list(String name, int num);
> 
> }
> 
> 
> The function header in Library.h (generated by javah -jni Library) is:
> 
> JNIEXPORT void JNICALL_Library_list(JNIEnv *,jobject,jobject,jint);
> 
> And I use this header in mylib.c
> 
> Thanks in advance
> 
>