6 messages in net.java.dev.jna.users[jna-users] Accessing DLL from web ap...
FromSent OnAttachments
idmnified .Feb 20, 2008 1:36 pm 
Timothy WallFeb 21, 2008 6:18 am 
idmnified .Feb 21, 2008 4:51 pm 
Timothy WallFeb 21, 2008 5:52 pm 
idmnified .Feb 24, 2008 5:18 pm 
Timothy WallFeb 25, 2008 6:38 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:[jna-users] Accessing DLL from web applicationActions...
From:idmnified . (idmn@gmail.com)
Date:Feb 24, 2008 5:18:08 pm
List:net.java.dev.jna.users

Running within a servlet container is a different question entirely. I think most folks who have done so have loaded JNA in a singleton instance separate from the servlet so that they don't have to worry about loading and unloading the native library, which can be problematic to do reliably.

That makes totally sense, so I tried it out this weekend, as well as adding some static here and there.. but no luck, loading goes well but I get no results. So looking further found some info pointing various notes regarding tomcat and dlls (out of scope of this list I guess), which I tried it but in all tests I got the UnsatisfiedLinkError. I tried adding a System.loadLibrary and then the Native.loadLibrary didn't throw any error, but then I got no results again.

Moreover, bad for me because when I told you I successfully could make work the DLL in a java console app, I ONLY tried it with the required dlls inside the main app dir. So this weekend I tried the console app with the dlls outside in another dir, and UnsatisfiedLinkError appeared. In this case, I managed to get it work doing several things (setting the java.library.path and/or the jna.library.path, putting DLL's in one of the PATH dirs...), and the error persisted.

So up to this point in my mind I have two paths and one confusing point. Confused because after searching the lists and the doc I don't know for sure if the dependent dlls get loaded without my intervention, just loading the main dll; how's it really?. And for both ways, or I'm loosing some essential point - like class and library paths concepts - , or one of the dependent dlls named MSVCRT is presenting conflicts, as it's a common windows dll, tho it seems its not the one being loaded by the main dll, could it be?

Thank you in advance,

Xavier