Tomcat e JNI

0 respostas
M

Desenvolvi uma aplicação web que utiliza JNI.
Até aí tudo bem, nos meus testes correu tudo OK.
Mas lendo uma documentação do Tomcat ví que há um problema com aplicações que usam JNI.
Aqui está o que ele diz:
"Applications that require native libraries must ensure that the libraries have
been 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 is
not loaded more than once. If the above code were placed in a class inside
the web application (i.e. under /WEB-INF/classes or /WEB-INF/lib), and the
application were reloaded, the loadLibrary() call would be attempted a second
time.

To avoid this problem, place classes that load native libraries outside of the
web application, and ensure that the loadLibrary() call is executed only once
during the lifetime of a particular JVM."

Bom, a minha classe que carrega a DLL fica dentro de WEB-INF/classes, então estou sujeeito a este problema, certo?
Então como faço para ter a classe em outro lugar que não seja WEB-INF/classes ou WEB-INF/lib?

Criado 15 de janeiro de 2008
Respostas 0
Participantes 1