I'm using LinkOS Java libraries to print from my webapp to USB printers running in a Tomcat 8 java container in Windows environment.
The ZSDK_API.jar is included in the webapp libraries and zDriverAdapter and ZebraNativeUsbAdapter_32 files are stored in tomcat /bin directory.
With this configuration, I can print and linkOS works as required.
But when I have to reload or update my project, Tomcat reloads the web application and after this process I get
com.zebra.sdk.comm.UsbNativeCodeConnectionException: The native code dll is not loaded.
at com.zebra.sdk.printer.discovery.UsbDiscoverer.getZebraUsbPrinters(Unknown Source) ~[ZSDK_API.jar]
And I cannot use LinkOs anymore.
The only solution for me is to restart tomcat service, after this the linkOS libraries work again.
I found that the inner error is:
java.lang.UnsatisfiedLinkError: Native Library ZebraNativeUsbAdapter_32.dll already loaded in another classloader
I should avoid the server reload because I have to stop all my applications instead of just the updated one.
Do you have any suggestion?