Stream: conformance
Topic: Validator throws ArrayIndexOutOfBoundsException with profile
Rob Eastwood (Apr 15 2020 at 21:42):
Trying to get the validator to validate example instances against a given profile, and am getting an ArrayIndexOutOfBoundsException error.
This occurs:
- with FHIR Validation tool Version 4.2.17-SNAPSHOT (current latest)
- using different examples in different IGs (tried with HL7 AU Base Implementation Guide and HL7 Bidirection Services eReferrals FHIR IG, and a local IG)
- only when the
-profile <URL>
switch is added to the command
The command used (once either of the above IGs are cloned locally) - having randomly chosen an example and paired profile:
java -jar FHIR-validator/org.hl7.fhir.validator.jar -version 4.0.1 input/resources/condition/condition-BSeR-Diagnosis-eve-everywoman-diabetes.xml -ig http://hl7.org/fhir/us/bser -profile http://hl7.org/fhir/us/bser/StructureDefinition/BSeR-Diagnosis
with the output
FHIR Validation tool Version 4.2.17-SNAPSHOT (Git# 4bd0d60e5c1a). Built 2020-04-12T08:25:34.223+10:00 (3 days old) Detected Java version: 13.0.2 from /usr/lib/jvm/java-13-openjdk on amd64 (64bit). 3964MB available Arguments: -version 4.0.1 input/resources/condition/condition-BSeR-Diagnosis-eve-everywoman-diabetes.xml -ig http://hl7.org/fhir/us/bser -profile http://hl7.org/fhir/us/bser/StructureDefinition/BSeR-Diagnosis Directories: Current = /home/rob/pc_stuff/fhir/IGs/bser, Package Cache = /home/rob/.fhir/packages Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 7 out of bounds for length 7 at org.hl7.fhir.validation.cli.Params.loadCliContext(Params.java:97) at org.hl7.fhir.validation.Validator.main(Validator.java:124)
The result is identical with the other IGs that I have tried. And without the -profile
parameter, the run is clean with expected output.
Having read the validator specs and the command line help, I think this is the correct invocation, but happy to be told otherwise.
Any clues?
Rob Hausam (Apr 21 2020 at 22:35):
I'm just trying the same thing now (it's been a little while) - trying to validate an instance with the IPS IG and our AllergyIntolerance profile with the latest validator (4.2.18), and I'm getting the same error Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 7 out of bounds for length 7
. @Grahame Grieve?
Grahame Grieve (Apr 21 2020 at 22:36):
@Mark Iantorno
Mark Iantorno (Apr 22 2020 at 14:04):
Fix is here: https://github.com/hapifhir/org.hl7.fhir.core/pull/180
Rob Eastwood (Apr 23 2020 at 05:01):
Thanks @Mark Iantorno and @Grahame Grieve
Can I ask though - I see that the PR has been merged in, but does this need for me to wait for a new version of the Validator or does "cloud magic" happen?
I ask because re-running the command in the original post, I still get a failure, albeit slightly different:
java -jar org.hl7.fhir.validator.jar -version 4.0.1 input/resources/condition/condition-BSeR-Diagnosis-eve-everywoman-diabetes.xml -ig http://hl7.org/fhir/us/bser -profile http://hl7.org/fhir/us/bser/StructureDefinition/BSeR-Diagnosis FHIR Validation tool Version 4.2.18-SNAPSHOT (Git# 175d5fa0b72d). Built 2020-04-21T14:15:21.346+10:00 (48 hours old) Detected Java version: 1.8.0_191 from C:\Program Files\Java\jre1.8.0_191 on amd64 (64bit). 3625MB available Arguments: -version 4.0.1 input/resources/condition/condition-BSeR-Diagnosis-eve-everywoman-diabetes.xml -ig http://hl7.org/fhir/us/bser -profile http://hl7.org/fhir/us/bser/StructureDefinition/BSeR-Diagnosis Directories: Current = C:\work\git\bser, Package Cache = C:\Users\rob.eastwood\.fhir\packages Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7 at org.hl7.fhir.validation.cli.Params.loadCliContext(Params.java:97) at org.hl7.fhir.validation.Validator.main(Validator.java:124)
Maybe there is something I need to do my end?
Grahame Grieve (Apr 23 2020 at 05:08):
I haven't done a release yet
Rob Eastwood (Apr 23 2020 at 05:08):
gotcha - sorry for the noise!
Rob Eastwood (Apr 23 2020 at 22:38):
Thank you very much @Mark Iantorno and @Grahame Grieve - I can confirm that is now fixed
Last updated: Apr 12 2022 at 19:14 UTC