We have a custom plugin for reading from a serial port. This plugin loads different nativelib’s for different platforms as we have defined in a .jnlp file.
The plugin works fine in servoy 5, but we have problems getting the plugin working in servoy 6. We suddenly have a UnsatisfiedLinkError. The nativelib is not being loaded.
We’ve tried a couple of things but without luck. There must be someting different in Servoy 6. Is there maybe a change in the classloader, or does anyone have a clue of what could be the cause of this?
As always with native lib, you have to take into account the architecture as well.
Meaning you need to provide 32 and 64 bit libs separately, so something like:
we’ve tried this also, actually we do it exactly like in your example. but I was trying some different things and posted the latest trial version of the jnlp file.
in servoy 5 the example like you’ve given works, but in servoy 6 it gives us an error: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
this must be that the nativelib is not loaded. is it correct that servoy automatically adds all the plugins to the classpath? I would expect that the loading of resources as specified in the jnlp would work the same way in servoy 6 as in servoy 5.
I’ve tried so many things but could not conclude otherwise than there must be something different going on with servoy 6 regarding the loading of these resources?!
Maybe you’ve updated the rxtxcomm lib, and now you’ve got more than one version in your java.library.path?
What I do more and more now with native libs (and this helps a lot), is that I deploy them myself (based on the os/arch), usually in a subfolder of $user.home$/.servoy/ then I load the one I need using an absolute path with System.load(path);
I have to explore your solution, I’m not that experienced yet in that area. But for now I’ve got it working on my developer machine by putting the .dll (which is in the nativelib) in the Windows/System32 directory. I still have to test in the deployment what happens there, in the end it needs to be working for all platforms. But in servoy 5 it all works fine, is it that servoy 6 maybe doesn’t add everything from plugins to the java.library.path?