

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
7 messages in net.java.dev.jna.usersRe: [jna-users] ClassLoaders and jnid...| From | Sent On | Attachments |
|---|---|---|
| Donszelmann Mark | Jun 18, 2009 7:12 am | |
| Timothy Wall | Jun 18, 2009 7:41 am | |
| Donszelmann Mark | Jun 18, 2009 9:15 am | |
| Timothy Wall | Jun 18, 2009 9:43 am | |
| LYou...@gkservices.com | Jun 18, 2009 10:30 am | .sig |
| LYou...@gkservices.com | Jun 18, 2009 10:31 am | .sig |
| Donszelmann Mark | Jun 21, 2009 6:19 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [jna-users] ClassLoaders and jnidispatch | Actions... |
|---|---|---|
| From: | LYou...@gkservices.com (LYou...@gkservices.com) | |
| Date: | Jun 18, 2009 10:30:25 am | |
| List: | net.java.dev.jna.users | |
| Attachments: | ![]() PGP.sig - 0.7k | |
You could either just have your upper class loader load in the JNA dll prior to engaging their snippit of java code, which means you'd have it always, even if no snippit used jna. Or you could just have your custom class loader filter and defer jna up to the parent classloader which would be better, imho.
Levi Yourchuck Senior Programmer Analyst G&K Services Phone: 952 912 5828 www.gkservices.com Enhancing Image & Safety Through Innovation This e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal.
Donszelmann Mark <Mark...@slac.stanford.edu> Sent by: Mark Donszelmann <mark...@gmail.com> 06/18/2009 11:15 AM Please respond to use...@jna.dev.java.net
To use...@jna.dev.java.net cc
Subject Re: [jna-users] ClassLoaders and jnidispatch
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








.sig