6 messages in net.java.dev.jna.usersRe: [jna-users] Accessing DLL from we...
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:Re: [jna-users] Accessing DLL from web applicationActions...
From:Timothy Wall (twal@dev.java.net)
Date:Feb 25, 2008 6:38:18 am
List:net.java.dev.jna.users

Any dependent DLLs for a given DLL must be either in the same directory or available in PATH (java.library.path *might* work, but might not).

Use the depends.exe utility to find all dependencies.

If MSVCRT.DLL is causing problems, determine which one is being used by your tomcat container, then make sure that's the one that gets loaded by your loadLibrary call. MS provides several flavors of MSVCRT depending on options you want enabled.

On Feb 24, 2008, at 8:18 PM, idmnified . wrote:

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,