Native libraries may be loaded only once at a time.
If the class loader which loads com.sun.jna.Native is GC'd (and
finalized), the native library will be unloaded , at which point
another class loader can load it (this process has been improved
somewhat in the code in SVN -- see JNAUnloadTest).
What is the error you are getting? What are you trying to accomplish
(i.e. why is JNA being loaded more than once)?
If you're running in an application container, you may not have a
choice where or when to load things.
On Jun 18, 2009, at 10:12 AM, Donszelmann Mark wrote:
Hi
we seem to have a problem loading jnidispatch.dll for the second time.
Reason is (probably) that the classloader that loads the first jna
classes gets trashed.
The second classloader tries to find jnidispatch (which we have on
our PATH)
and does not find it.
Is this at all possible (to load jnidispatch twice), or should we
make sure we load
jnidispatch from a class loaded by the systemclassloader, and if so,
how ?
Regards
Mark Donszelmann