Hi, 
 
I am writing a servlet that needs to access some native
'C' code through JNI. The small example that I tested did
not work because the Apache JServ through an exception.
Following are the details: 
 
1) I added the following line to my jserv.properties file: 
   wrapper.env=LD_LIBRARY_PATH=/fullPathTo/myNativeFuncs.so 
2) I started the apache web server.
3) The shared object specified in the class's static
   initializer seems to load fine as it does not throw
   any exceptions (as it did before I figured out about
   the wrapper.env option).
4) The servlet engine calls my servlet's init method
   (therefore it must have succesfully loaded my class
   and presumably the shared object file).
5) The servlet engine calls my service method in which I
   make a call tothe JNI function. I get the following
   output in the error log:
 
   java.lang.UnsatisfiedLinkError: myNativeFunction
       at org.apache.jserv.JServConnection.run
           (JServConnection.java:365)
       at java.lang.Thread.run(Thread.java:474)

Why is it that the JServerConnection is throwing an
unsatisfied link exception when I know the shared obect
file was loaded (I know the shared object loaded correctly
because java did not throw an an exception in the static
initializer where the shared object file was loaded)?

Additionally, I should mention that I tested the class
stand-alone with a simple main method that made a
call successfully to the shared object through JNI.

Any help would be greatly appreciated.

Thanks,
Michael



----------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to