Re: JNI with AXIS - InvocationTargetException

2004-01-23 Thread Sai Pradeep - Hotmail



Hi All!

Thanks to everyone who gave their valuable 
suggestions and ideas in eliminating my exception. I resolved my exception 
successfully.

So, my suggestion for all those who want to invoke 
a JNI application from AXIS Service is as follows.

1. Check whether the JNI application works offline, 
I mean when it is not deployed on the Tomcat. If it works fine, 

2. then check whether you have copied the DLL and 
LIB files of your c/c++ application in your System path. i.e., in 
Windows/System32 folder. It is mandatory to copy both the DLL and LIB files in 
to this folder.If the files are not placed 
in the System path, you will get an InvocationTargetException.

Optional Check whether you have placed all 
the dependency classes, if you have anyin the webapps/axis/package 
name of your tomcat server.

Hope this works!!! Best of luck
Cheers
Sai.


RE: JNI with AXIS - InvocationTargetException

2004-01-12 Thread Martin, Richard
Title: Message



Hi 
Sai,

I'm not sure what 
container you are running Axis in. However there is an entry in the Tomcat 5.0 
release notes relating to JNI with tomcat: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/RELEASE-NOTES.txt

The following is 
copied verbatim:

-Tomcat 5.0 and JNI Based 
Applications:-Applications that 
require native libraries must ensure that the libraries havebeen loaded 
prior to use. Typically, this is done with a call like: 
static { 
System.loadLibrary("path-to-library-file"); }in some 
class. However, the application must also ensure that the library 
isnot loaded more than once. If the above code were placed in a class 
insidethe web application (i.e. under /WEB-INF/classes or /WEB-INF/lib), and 
theapplication were reloaded, the loadLibrary() call would be attempted a 
secondtime.To avoid this problem, place classes that load native 
libraries outside of theweb application, and ensure that the loadLibrary() 
call is executed only onceduring the lifetime of a particular 
JVM.

-


I'm not sure 
whether this has any relevance to your container but I remember reading that 
there was a similar problem with Tomcat 4.x series of applications, and it looks 
like the steps listed above might be true of other servlet containers as 
well.

Hope this 
helps,

Richard


  
  -Original Message-From: Sai Pradeep - 
  Hotmail [mailto:[EMAIL PROTECTED] Sent: 13 January 2004 
  00:42To: [EMAIL PROTECTED]Subject: JNI with AXIS - 
  InvocationTargetException
  Hi All!
  
  I came to know from the mailing list that many 
  people used Jni with Axis. My task was to develop a web service which can 
  invoke a JNI. Whenever I try to invoke jni from my service I get an Exception 
  "InvocationTargetException". When i try to run this jni application without 
  deploying it onthe Axis, everything seems to work fine. I would be 
  grateful to you, if anyone of you could be able to get me out of this 
  Exception.
  
  Cheers
  Sai.