geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juergen Weber <webe...@gmail.com>
Subject JNI and classloaders on Restart
Date Fri, 16 Jan 2009 12:40:55 GMT

A given native library cannot be loaded by more than one classloader.
(http://java.sun.com/docs/books/jni/html/design.html -> 11.2.4)

So if a Geronimo application, that uses JNI, is restarted, the new
classloader cannot load the library and gets java.lang.UnsatisfiedLinkError:
xx (Library is already loaded in another ClassLoader)

But what if you let the JNI be loaded from a different, non restartable
classloader?
http://cwiki.apache.org/GMOxDOC22/classloading.html
"Plugins become parents of the classloader whereas jars become available
directly in the classloader. "

Does that mean, that a jar in the repository is within the thrown away
classloader whereas a jar in a plugin is not? Then loading a DLL from a
plugin would be the solution to load a native library from a non-restartable
classloader, wouldn't it?

Thanks,
Juergen
-- 
View this message in context: http://www.nabble.com/JNI-and-classloaders-on-Restart-tp21498531s134p21498531.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message