0

When running the Repast Simphony GUI, I can supply JVM options to get around the IllegalAccess exceptions (e.g. --add-opens <module>/<package>=ALL-UNNAMED). When I try to run in batch mode, the JVM arguments do not get passed along to where the run is kicked off.

For example, I get an IllegalAccessError "because module java.xml does not export com.sun.org.apache.xpath.internal.objects to unnamed module" even though I have this in my VM arguments: --add-opens=java.xml/com.sun.org.apache.xpath.internal.objects=ALL-UNNAMED.

How can I pass the "add-opens" VM arguments I need to a batch run? Without being able to do that, I am stuck on Java 11. I am using Repast 2.10.0.

I tried to upgrade from Repast 2.9.1 with Java 11 to Repast 2.10.0 with Java 17. Using Repast 2.10.0 with Java 11 works, but I get the above errors (or similar) with Java 17.

1 Answers1

0

You should be able to add the required "add-open"s to the VM arguments box in the Batch Run Configuration GUI. The box is a bit small for adding all the required arguments (it was coded prior to all this being necessary), but it should work. I'll add an issue to our issue tracker to make the required Java 17 arguments part of the defaults.

Update: Possible fix outlined here:

https://github.com/Repast/repast.simphony/issues/86

Nick Collier
  • 1,786
  • 9
  • 10
  • Thanks for the reply. Adding them to that box doesn't seem to work. I get the same errors when I run it with/without the "add-opens" options in there. For more context, I'm essentially running StandAloneMain.main. I've tried passing the VM options in there too, but they don't do anything when the model is run, only for my main method. My model can be built successfully and kicked off, but it fails right away once I see "Running model on localhost" on the command line. It seems like they need to be included in the java command when the model is run by the SessionsDriver (session.runModel()). – smlutz2 Jul 24 '23 at 19:20
  • OK. Thanks. I'll try some tests here to see what's up. – Nick Collier Jul 24 '23 at 20:02
  • Thanks Nick. Fwiw, I've been messing with it some more and I was able to get it to run by segmenting my batch run into two steps: build the complete model jar, then use InstanceRunner from within the complete_model directory. Passing in the "add-opens" VM options to InstanceRunner does work and my model ran successfully. So it seems like it's only an issue if I use batch_runner with the `-r` option, or try to run the batch run from the GUI. This workaround isn't ideal, but at least it's running! – smlutz2 Jul 24 '23 at 20:24
  • @smlutz2 I think we may have fixed this. Can you try the solution here: https://github.com/Repast/repast.simphony/issues/86? Please leave any comments on the github issue and not here on SO. – Nick Collier Aug 24 '23 at 15:27