Pablo - What do you mean by "Tomcat Crash", is there an exception message at all?  If 
you aren't using a web-application where you could see the error message on the 
displayed page, you can check the Tomcat logs to see what Tomcat is complaining about 
prior to the crash.  

I have two different web-applications that use JNI to access a C device driver and a 
VB DLL for some server software on one of our cabinets.  In general, we would get 
something along the lines of an unsatisfied link error on the line where you first 
make a call to the native function (not where you do the System.loadLibrary(XXX), that 
usually succeeds).  

The problem for me (and a fellow developer attempting something similar) was that when 
we created the JNI header file "javah -jni ..." (-jni is now a default, so its 
unnecessary to specify it) we didn't include the entire path to the package/class of 
the java file using the jni.  Generally with jni (at least in my exp.), you end up 
with a header file created by jni that has a very long name - as it includes the 
entire path to the class file that uses the jni functions (such as 
mil_navy_XXX_XXX_XXX.h) in my case.  

If you have created this header file incorrectly, you will still be able to run the 
application statically - but as soon as you run it through tomcat and it attempts to 
go through the JNI to access the native function, it will fail because it cannot link 
to the appropriate location for the function.

Eden 


-----Original Message-----
From: J.Pablo M [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 08, 2004 1:00 PM
To: [EMAIL PROTECTED]
Subject: Problems with Tomcat and JNI

Hi.

I'm runnin a Web aplicacion wich uses a Java Class that  loads a native library (JNI). 
 This Class is placed in a jar file at  /common/lib/ The .so file is placed inside the 
jdk at  /JAVA_HOME/jre/lib/i386/ I sucesfully build and test an standalone application 
to  the use of the JNI.  But  when I test the Class method in the Web aplication with 
Tomcat, as soon as I try to use the native metod, the Tomcat CRASH.
I dont know if must keep the .so file placed at the jdk directory mencioned above, 
otherwise... WHERE shoud I place the .so file ??

Juan Pablo Mu�oz Vidal

_________________________________________________________________
MSN Amor: busca tu � naranja http://latam.msn.com/amor/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to