if you have 2 webapps, and each requires this .dll file, BUT..
you are not sure which one, or if BOTH will be in your webapps dir, then
how can you ensure that your loadlibrary call is done once

The issue is that we are deploying tomcat and 1 or 2 webapps to a client.
It is client specific as to how many webapps they get. Both apps require
this dll file.
How can I load it once so that the webapps can use its functions?
I am playing with a host Listener right now, where I statically loadlibrary
the dll,
but I am wondering if there is an easier way.
I have a listener that does this:
package tcsServices;

import org.apache.catalina.*;

public class HostLifecycleListener implements LifecycleListener{
        static {
                System.loadLibrary("cryptoAlgs");
          }

        public void lifecycleEvent(LifecycleEvent event) {
                System.out.println("IN THERE*******************************");
}

}
I get the debug message from above, so I know the .DLL is loading (i.e.,
loadLibrary call made).
I have the jar file holding the JNI class that wraps the dll library calls
and the .DLL in shared\lib
I have shared\lib in my classpath and library path via JAVA_OPTS=-classpath
"%CATALINA_HOME%\shared\lib" -Djava.library.path="%CATALINA_HOME%\shared\lib
"

But when my webapp's applifecycle listener starts and tries to run a library
function, I get a unsatisfiedlik error - as if the library did NOT get
loaded?!? here is the error:
Mar 3, 2006 3:24:49 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance of
class tcsServices.AppLifecycleListener
java.lang.UnsatisfiedLinkError: Decrypt
        at tcsServices.TCSCryptography.Decrypt(Native Method)
        at tcsServices.Registry.getDbKeys(Registry.java:48)
        at
tcsServices.AppLifecycleListener.KillAllWebSessions(AppLifecycleListener.jav
a:214)
        at
tcsServices.AppLifecycleListener.contextInitialized(AppLifecycleListener.jav
a:59)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
3727)
        at org.apache.c
...

HELP!


John McClain
Senior Software Engineer
TCS Healthcare
[EMAIL PROTECTED]
(530)886-1700x235
"Skepticism is the first step toward truth"


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

Reply via email to