tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergio Juan" <sj...@gridsystems.com>
Subject Re: JNI with Servlets
Date Sat, 05 Jul 2003 10:29:32 GMT
Hi.

Have you linked the library (the best place to do it is at the init(), as
you can only link it once)? The code is something like this

  public void init () {
    try {
      //System.loadLibrary("myLib.so"); --> If you include it in
LD_LIBRARY_PATH
          System.load("/usr/local/lib/myLib.so");  // --> you don't need to
set LD_LIBRARY_PATH (I think)
     } catch (Exception ex) {
          System.out.println(" Can not load dinamic library. Reason: \n");
          ex.printStackTrace();
        }
    }

If you already do it please show your code so the group can help better.

Regards?

----- Original Message ----- 
From: <maillists@optonline.net>
To: <tomcat-user@jakarta.apache.org>
Sent: Saturday, July 05, 2003 2:25 AM
Subject: JNI with Servlets


> I'm attempting to use a shared library on Linux thats called from a
servlet that I have deployed on Tomcat 4.1.18.  Everytime I try to use the
servlet it throws an exception with an unsatisfiedlinkerror.  I've added
LD_LIBRARY_PATH=/usr/lib to my catalina.sh & startup.sh, modified the
classpath to include the .so, and copied the .so to server/lib, common/lib
and nothing seems to be working.
>
> Might anyone have some hints or simple examples of how to get this
working?
>
> Thanks,
>
> Jay
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message