synthetichealth / synthea

Synthetic Patient Population Simulator
https://synthetichealth.github.io/synthea
Apache License 2.0
2.12k stars 639 forks source link

Null Pointer Exception when trying to load 'allergies/allergy_incidence' #574

Open chrissten opened 4 years ago

chrissten commented 4 years ago

When we get to 'allergies/allergy_incidence', State:224 "Module submod = Module.getModuleByPath(submodule);" ends up with a null submod and throws at line 234.

I've traced it down to Module.java:161 and it's the "modules.get(path) thats returning null even though the module is there (index 26) 2019-09-15 15_58_59-eclipse-workspace - synthea_src_main_java_org_mitre_synthea_engine_Module java -

jawalonoski commented 4 years ago

Do you have steps to reproduce this error? I am not able to reproduce.

It looks like you are using Eclipse. Can you refresh your Eclipse project?

You can run:

./gradlew cleanEclipse eclipse

And then refresh the project in Eclipse.

dehall commented 4 years ago

Is this a fresh clone of synthea? I wonder if #557 broke the CallSubmodule state on Windows because file path handling is slightly different. I can double check that later this morning

chrissten commented 4 years ago

Yes, it's a fresh clone (a0db4398050d17c692d7e0f0dd8d490ac3951ff5). It does work if I run from Gradle. I was working in Eclipse so I could make a few changes to how the json data is emitted (adding a unique identifier to written files so they don't get overwritten if you set bundle_data = false).

After spending a few more hours banging my head against it last night, I discovered Eclipse was fetching the resources and referencing the 'synthia.jar' that gradle had generated. Once I removed that jar from my classpath and put the resources locally in the bin folder, that issue seems to have gone away.

chrissten commented 4 years ago

Also, I put a null check on the submod to just return true so the program doesn't crash, and it does seem that all 'submodules' are not working when referencing the jar.

jawalonoski commented 4 years ago

By bundle_data = false are you talking about FHIR bulk data? I'm not sure what bundle_data attribute or setting you are referring to.

chrissten commented 4 years ago

Sorry...I was listing properties from memory. I changed the default values in synthea.properties to have exporter.fhir.transaction_bundle = false exporter.fhir.bulk_data = false

But I don't think that has anything to do with the inability to read submodules from the .jar.