Hi Timothy,
On Jun 18, 2009, at 4:41 PM, Timothy Wall wrote:
Native libraries may be loaded only once at a time.
ok.
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)?
java.lang.UnsatisfiedLinkError: jnidispatch (/com/sun/jna/win32-x86/
jnidispatch.dll) not found in resource path
we run this in a program where our users can write their own little
java snippets. These we load with
a ClassLoader. I guess we need to load the JNA with the system
classloader so that it will be available
and not unloaded.
If you're running in an application container, you may not have a
choice where or when to load things.
we are in control. How do I make sure I load the JNA and the dll in
the system classloader up front.
Regards
Mark Donszelmann
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