I'm having issues deploying a servlet. The servlet uses JNA to load some DLLs, which are placed inside the classpath com.myproject..etc. (e.g. "my_dll.dll"):
public static final MyDllInterface INSTANCE = (MyDllInterface) Native.loadLibrary("./com/myproject/main/jna/dll/my_dll", MyDllInterface.class);
This works fine as long as I test these JNA Interfaces locally with test classes. As soon as I deploy them to glassfish (via Netbeans) I get errors like this:
java.lang.UnsatisfiedLinkError: Unable to load library './com/myproject/main/jna/dll/my_dll': The specified module could not be found.
I am suspecting it has something to do with how glassfish handles classpaths or maybe how loading inside *.war packed application works.
Things I've tried using:
- relative class paths (../dll_file)
- absolute class paths (com/etc and /com/etc)
- absolute system paths (C:/Users/etc)
Can anyone help?
(I'm using Netbeans 8.2, Glassfish 4.1.1 (comes with Netbeans) on Windows. DLLs were compiled on Windows C++ and work with my testing code)