I have a model in a scala project that throws a ClassNotFoundException when run from openmole.
The task is defined in my jar (built with sbt osgiBundle) like that:
object hmmmatcher {
def run(…)
}
Then, my workflow uses that task:
val hmmmatcherTask = ScalaTask(“val m = fr.ign.nm.hmmmatcher.run(…)”) set (
libraries += workDirectory / “nm_2.12-1.0-SNAPSHOT.jar”,
…
)
The error thrown is:
org.openmole.core.exception.InternalProcessingError: Error for context values in org.openmole.core.workflow.tools.InputOutputCheck$@4b77d812 {fileNetwork1=/home/julien/.openmole/michele-julien-1/webui/projects/nm/snapshot_1825.0_1836.0_edges.shp, fileNetwork2=/home/julien/.openmole/michele-julien-1/webui/projects/nm/snapshot_1784.0_1791.0_edges.shp, idAttribute1=ID, idAttribute2=ID, lpsolving=0.0, openmole$seed=-7076074100557766095, resampling=0.0, selection=10.0, stroke_length=10.0}
Caused by: java.lang.NoClassDefFoundError: fr/ign/nm/hmmmatcher$
at $line3.$read$$iw$$iw$$anonfun$1.apply(:25)
… 32 more
Caused by: java.lang.ClassNotFoundException: fr.ign.nm.hmmmatcher$
at scala.reflect.internal.util.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:62)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 33 more
I checked in the jar and the class is there (and in the MANIFEST too as exported).
Any idea?
Thanks
Julien