Native library and ignition issue

I have those files in place.

After changing the service to run as my user instead of the local service account your expression function works, however, this only seems to be true on Windows 7. I was previously trying on Windows 10 and it didn’t work either way.

I still think there’s some file permission issues you’re going to need to work out. It might have something to do with where you’re trying to load the files from; I can run your example jar when all the files are sitting in a SomaTest folder on my desktop but it fails with an UnsatisfiedLinkError when run from C:\Program Files\Inductive Automation\Soma.

Hey Kevin,

It took me some time to figure out what the problem was you described because I couldn't reproduce the scenario at my side. So I run the jar on several VMs with different Windows OS and finally I fount it out. If FolderFinder.getFolderLocation("Soma") hits a folder on his way where he is not allowed to see it's content (permission denied), it stops and delivers an empty String instead of continuing... Therefore, you get the UnsatisfiedLinkError and thought it would be an permission error!

I am sorry for that, I didn't new that... I try to fix this, but in the meantime, please just use an absolute path to the Soma folder containing the files, this should work on your side in every case and also on ignition.

I tested it, and it didn't made a difference on my side. So I suppose, the scan class still hangs for another reason this time...

In other words:

  • Running the jar file with this absolute path "C:\Program Files\Inductive Automation\Soma" delivers the expected result.

  • Using the same path "C:\Program Files\Inductive Automation\Soma" within ignition delivers nothing as before...

Hence, the code should look like this:

static {
System.load(loadFile("C:\Program Files\Inductive Automation\Soma\SomaWrapper.dll");
// System.load(FolderFinder.getFolderLocation("Soma") + "\SomaWrapper.dll");
}