Wrapper: jna UnsatisfiedLinkError

Issue #65 closed
Hannes Krauß created an issue

Hi javaFMI team,

I couldn't find another (better) place to post my question.

I try to use the javaFMI Wrapper in a maven project and when calling

new Simulation("src/main/resources/name.fmu")

the following Exception occured:

java.lang.UnsatisfiedLinkError: Unable to load library '/tmp/fmu_1464602057664name/binaries/linux64/name.so': Native library (tmp/fmu_1464602057664name/binaries/linux64/name.so) not found in resource path ([list of paths including target/classes and .m2/repositories, not including /tmp/*]) at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271) ...

What do I have to do to make it work? I hope it's something obvious, otherwise, what kind of additional information would you need? The surrounding project is rather complex, but if neccessary I could try to extract a small example project to test this issue.

regards Hannes

Comments (13)

  1. Jose Evora

    Hi Silberschatten,

    Thanks for reporting. At this moment, I can only think of libraries that are needed by name.so that cannot be found. Which tool was used for creating this fmu?. May I have this fmu to check what may be happening?

    Best,

  2. Jose Evora

    Hi Hannes,

    I've tried the fmu and I have the same error. Have you tried to use it with other FMU wrappers? Did you manage to do it? I have the feeling there are missing libraries that comes with OpenModellica. The computer in which you are launching the fmu has OpenModellica installed?

    I suggest you to read this post:

    https://bitbucket.org/siani/javafmi/issues/59/error-looking-up-function-when-trying-to

    It seems you're experiencing the same problem than Daniel Gomez. I don't know if managed to solve it but he was going to look for an answer on the OpenModellica side. As you can see, I did a dependency analysis using Dependency Walker (on windows) and there were some missing dlls that are part of OpenModellica. I guess this may be happening to you on Linux.

    Maybe you could contact him. If he or you manage to get it working, it would be great to know how so that we can better inform JavaFMI users.

    Best regards

  3. Hannes Krauß reporter

    Intermediary notice: The fmu was compiled on a different system, this seems to have been the reason for the error. That system compiled the fmu as 32 bit classes (Though we are not completely sure what and why exactly happened). The fmuChecker threw fatal errors when checking on my system, of the form: wrong ELF class: ELFCLASS32

    After compiling it on my system the fmuChecker leaves with a segmentation fault after completing a simulation run successfully, in our program the javafmu wrapper terminates with

    JSON object expected ',' or '}', got: "lineEnd":6,"colStar
    

    For now I'll contact the fmuChecker team, meanwhile: Is the cause of that error (JSON object expected...) known? A quick search through the issues here didn't reveal anything on that...

    regards Hannes

  4. Jose Evora

    Do you have a fmu including all needed dependencies? If so, you could give it to me to have a look on that JSON error. I haven't seen that before.

    At which operation it happens? init? reading a variable? writing? doing step? terminating?. It's quite strange.

    I don't know if it may be an internal error of the fmu that is being printed out by the wrapper.

    If you have a fmu including all dependencies I could give it a try.

    Best,

  5. Hannes Krauß reporter

    This error occurs during Simulation.<init>, FmuProxy.instantiate, Fmu.instantiate, there it trails of into jna black magic..

    I hope this is dependency complete, not sure how to test that easily.

    Thanks

  6. Jose Evora

    I still have the UnsatisfiedLinkError when opening test.fmu. It seems there are still missing dependencies.

  7. Jose Evora

    What Anatoly says makes sense. We had difficulties when building fmus in Linux in first java fmi releases. Our library for Linux sets the lc_numeric with "c" value like here.Otherwise we had problems executing them.

  8. Log in to comment