SciGaP / simccs-maptool

Online maptool that provides novel decision-support capabilities for evaluating carbon capture, utilization and storage technologies (CCUS).
5 stars 0 forks source link

JVM exception when creating a MPS file in community case study #164

Closed machristie closed 3 years ago

machristie commented 3 years ago

Only seeing this issue in production/master branch. Oddly, if I click on Generate Candidate Network first and then Generate MPS file, the MPS file gets generated successfully.

Stack trace:

[Wed Sep 01 15:10:18.844208 2021] [wsgi:error] [pid 18416] [remote 140.182.79.131:59108] Error occurred when calling writeCapPriceMPS: ['java.lang.NullPointerException', 'solver.MPSWriter.writeCapPriceMPS(MPSWriter.java:188)']
[Wed Sep 01 15:10:18.844233 2021] [wsgi:error] [pid 18416] [remote 140.182.79.131:59108] Traceback (most recent call last):
[Wed Sep 01 15:10:18.844236 2021] [wsgi:error] [pid 18416] [remote 140.182.79.131:59108]   File "/var/www/portals/django-iu-geology-survey/venv/src/simccs-maptool/simccs_maptool/simccs_helper.py", line 190, in write_mps_file
[Wed Sep 01 15:10:18.844239 2021] [wsgi:error] [pid 18416] [remote 140.182.79.131:59108]     "c",  # modelVersion = "c" for capture
[Wed Sep 01 15:10:18.844241 2021] [wsgi:error] [pid 18416] [remote 140.182.79.131:59108]   File "jnius/jnius_export_class.pxi", line 768, in jnius.JavaMethod.__call__
[Wed Sep 01 15:10:18.844243 2021] [wsgi:error] [pid 18416] [remote 140.182.79.131:59108]   File "jnius/jnius_export_class.pxi", line 951, in jnius.JavaMethod.call_staticmethod
[Wed Sep 01 15:10:18.844246 2021] [wsgi:error] [pid 18416] [remote 140.182.79.131:59108]   File "jnius/jnius_utils.pxi", line 91, in jnius.check_exception
[Wed Sep 01 15:10:18.844249 2021] [wsgi:error] [pid 18416] [remote 140.182.79.131:59108] jnius.JavaException: JVM exception occurred: java.lang.NullPointerException
machristie commented 3 years ago

I was able to fix this by copying the candidate network files from the dev server. The code tries now to reuse the case study's candidate network (see #72) but those candidate network files were only on the dev server.

Still, if the candidate network file isn't available it should get generated as needed. I'll see if I can fix that.

machristie commented 3 years ago

I can't reproduce this locally. I thought this had to do with the candidate network reuse, but when I remove that code I still see the mps file generated locally. Also, I was able to confirm that the candidate network gets generated on demand. That is, if the CandidateNetwork.txt is missing in the scenario directory, it gets generated as a side effect of calling MPSWriter.writeCapPriceMPS().

I think this was a data issue and when I copied the data over from the dev server, that fixed it. I can't remember if there was some data issue that we fixed on dev, but I'm assuming we did at some point, perhaps when upgrading to a newer version of SimCCS.jar.