Repast / repast.simphony

Git repository for Repast Simphony development
repast.github.io
91 stars 21 forks source link

Batch Runner Can't Find Groovy #96

Open ncollier opened 2 months ago

ncollier commented 2 months ago

Stand alone batch runner run can't find the groovy jar

INFO  10:15:24,983 repast.simphony.batch.gui.HeadlessMain - Writing batch run config file to: <my_repast_directory>\output\config.props
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at repast.simphony.batch.standalone.StandAloneMain.run(StandAloneMain.java:207)
        at repast.simphony.batch.standalone.StandAloneMain.main(StandAloneMain.java:276)
Caused by: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
        at repast.simphony.batch.gui.HeadlessMain.createAntProject(HeadlessMain.java:87)
        at repast.simphony.batch.gui.HeadlessMain.run(HeadlessMain.java:66)
        at repast.simphony.batch.gui.HeadlessMain.main(HeadlessMain.java:310)
        ... 6 more
Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyObject
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        ... 9 more
ncollier commented 2 months ago

Groovy jar is: groovy-3.0.21-indy.jar and we use a regex to find it -

private static final String VNUM_REGEX = "(\\d+\\.)(\\d+\\.)(\\d)";
private static final String INDY_REGEX = "groovy-" + VNUM_REGEX + "-indy.jar";

The regex needs additional "+" on the last "d".

private static final String VNUM_REGEX = "(\\d+\\.)(\\d+\\.)(\\d+)";
ncollier commented 2 months ago

New batch runner jar with updated regex is attached batch_runner.jar.zip

This finds the groovy libraries but there seems to be an issue with the jvm --add-export args not being used. Continue testing.