We are using YAJSW to wrap our Java application as a Windows Service. While testing workstation images there is a warning from the corporate McAfee Antivirus because on launching the service, the jnidispatch.dll is copied from the jna-4.1.0.jar to a new name in a temporary folder.
Adding the dll signature to the antivirus rules prevents a showstopping error but a severe warning pops up every time.
We tried copying the jnidispath.dll to C:\DLLfolder and adding to wrapper.conf the line:
wrapper.java.additional.4 = -Djna.boot.library.path=C:/DLLfolder/
We then added C:\DLLfolder to the Windows System %PATH% and rebooted Windows.
However when monitoring the Windows Service start, we can still see the DLL being extracted from the Jar instead and the antivirus complains.
The comments in the YAJSW code native.java say:
When JNA classes are loaded, the native shared library (jnidispatch) is
loaded as well. An attempt is made to load it from the any paths defined
in <code>jna.boot.library.path</code> (if defined), then the system library
path using {@link System#loadLibrary}, unless <code>jna.nosys=true</code>.
If not found, the appropriate library will be extracted from the class path
(into a temporary directory if found within a jar file) and loaded from
there, unless <code>jna.noclasspath=true</code>.
What step are we missing?
I confirm we resolved with the following actions:
1) added -Djna.nounpack=true to wrapper.conf
2) deleted the 2 jnidispatch.dll 32-bit and 64-bit DLLs from the JAR
3) Placed the DLLs on the Windows path
Please note to install the Windows Service, the jnidispatch.dll is required.
Big thanks to technomage!