[Scilab-users] Problem with dependency in Java to be accessed through Scilab

Hekma Enne (THALES SERVICES) Enne.Hekma at cnes.fr
Tue Apr 3 13:14:57 CEST 2018


We have the following problem in our Scilab/Java project. The project is written in Java and the Java functions are accessed through Scilab. This works fine and as expected without the new dependency. Because of a new functionality of the code we would like to add a dependency on Spice (a program by JPL to provide ephemerides of, in our case, small bodies in the solar system). The Spice dependency works fine and as expected when used in Java directly, with Eclipse Juno, but when we try to use this functionality in Scilab it won't work.

The dependency of Spice consists of a .jar file with the functions and a .dll dynamic library. In Java the .jar file is added to the pom.xml and the .dll is loaded in a static block using System.loadLibrary("JNISpice");. When we use the functionality in Scilab for the first time it gives one error;
jinvoke: An error occured: Exception when calling Java method : An exception has been thrown in calling the method run:
java.lang.UnsatisfiedLinkError: spice.basic.CSPICE.erract(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
And if we run the same function a second time, it gives a different error;
jinvoke: An error occured: Exception when calling Java method : An exception has been thrown in calling the method run:
java.lang.NoClassDefFoundError: Could not initialize class spice.basic.CSPICE

This leads to us believing that at least some part of the dependency is found by Scilab, but not completely. We hope you could give us an indication of where the problem might be.

Thanks in advance!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180403/f05b5d36/attachment.htm>


More information about the users mailing list