JNI

2006-02-20 Thread Paul Michael Reilly
I have now painfully learned to use the Tomcat shared area to supply
JNI code for my web application.  However there are still a few
questions that linger:

1) Using the Axis 1.3 (binary distribution) webapp, I modified
   EchoHeaders (as shown below) to load a shared library which
   predictably works only once as I now understand because of the
   class loading issue.  Subsequent attempts to rerun the EchoHeaders
   service fails with the response indicated below.  What I don't
   understand is why the exception is not caught by EchoHeaders.jws
   instead of Axis such that I'd see "took exc".

2) (More of a Tomcat issue) Using the
   .../tomcat/shared/... directories to contain classes and jarballs
   containing JNI seriously breaks the loose coupling between Tomcat
   and a webapp.  Where deploying a war file is simple, reliable and
   satisfying on each release of the app, dealing with getting the
   webapp that consumes JNI code deployed or updated is a multi stage,
   tightly coupled process and requires restarting the container
   (unless I have overlooked some Tomcat provided feature to
   auto-reload shared jar files or classes).  So I wonder why Tomcat
   does not treat this as an issue/bug and fix it in the future.
   Perhaps it is in the plan.

-pmr


EchoHeaders.jws:

...
public String jni() {
String result = "failed";
try {
System.loadLibrary("nativelib");
result = "worked";
} catch ( Exception exc ) {
savedExc = (Throwable) exc;
result = "took exc"
}

return result;
}

...


Axis response:


  

  soapenv:Server.userException
  java.lang.reflect.InvocationTargetException
  
copa.pajato.com
  

  




Axis 1.3 installation issues on Fedora Core 4

2005-11-22 Thread Paul Michael Reilly
I have installed Axis 1.3 on FC4 using the gcj compiled components
(jvm, tomcat5) and mostly everything works.  There are two issues that
I'd like to resolve just because ...

The first is that happyaxis reports a warning about not being able to
find the org.apache.xml.security.Init class.  I grabbed xmlsec (1.3)
from the Apache XML web site and put it into the tomcat5
webapps/axis/lib directory and restarted tomcat. catalina.out then
reports SEVERE errors.  Since this is not a critical issue I moved
xmlsec.jar out of the picture and continued but it would be nice to
know if there is an easy fix.

The second issue is that a compiler is not being found.  On the
http://localhost:8080/axis page is a link to EchoHeaders.jws (WSDL).
I clicked on this link to get an Axis error page that reports no
compiler is found on the classpath.  I tried adding a link to
/usr/lib/jvm/java/lib/tools.jar into the tomcat5/common/lib dir but
this did not solve the problem.

Suggestions?

Thanks,

-pmr