7 messages in net.java.dev.jna.usersRe: [jna-users] ClassLoaders and jnid...
FromSent OnAttachments
Donszelmann MarkJun 18, 2009 7:12 am 
Timothy WallJun 18, 2009 7:41 am 
Donszelmann MarkJun 18, 2009 9:15 am 
Timothy WallJun 18, 2009 9:43 am 
LYou...@gkservices.comJun 18, 2009 10:30 am.sig
LYou...@gkservices.comJun 18, 2009 10:31 am.sig
Donszelmann MarkJun 21, 2009 6:19 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] ClassLoaders and jnidispatchActions...
From:Timothy Wall (twal@dev.java.net)
Date:Jun 18, 2009 7:41:23 am
List:net.java.dev.jna.users

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