Stream: implementers
Topic: Validator throws error message with -defn parameter
Pieter Edelman (Apr 30 2019 at 14:09):
Hi,
I'm trying out the Java validator, but I run into an error if I manually try out the example steps described on http://hl7.org/fhir/STU3/validation.html#jar. The problem occurs when using the definitions.xml.zip file:
PS C:\Users\Edelman\Downloads> java -jar .\org.hl7.fhir.validation.cli.jar .\patient-example.xml -defn .\definitions.xml.zip
FHIR Validation tool Version 3.8.0-SNAPSHOT - Built 2019-02-11T12:49:16.829-05:00 - Git 7a8671008476
Arguments: .\patient-example.xml -defn .\definitions.xml.zip
.. connect to tx server @ http://tx.fhir.org
.. definitions from .\definitions.xml.zip
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" java.lang.Exception: Unable to find/resolve/read -ig .\definitions.xml.zip
at org.hl7.fhir.r4.validation.ValidationEngine.loadIgSource(ValidationEngine.java:435)
at org.hl7.fhir.r4.validation.ValidationEngine.loadDefinitions(ValidationEngine.java:318)
at org.hl7.fhir.r4.validation.ValidationEngine.loadInitialDefinitions(ValidationEngine.java:283)
at org.hl7.fhir.r4.validation.ValidationEngine.<init>(ValidationEngine.java:308)
at org.hl7.fhir.r4.validation.Validator.main(Validator.java:367)
I tried to re-download everything and even to compile the latest version of the validator, but the error remains. Any idea what I'm doing wrong?
I'm using the Oracle OpenJDK 1.8
Lloyd McKenzie (Apr 30 2019 at 14:34):
Are you grabbing the current validator from http://build.fhir.org/downloads.html?
Pieter Edelman (May 01 2019 at 08:39):
Are you grabbing the current validator from http://build.fhir.org/downloads.html?
Yes, I'm using the most recent version.
Grahame Grieve (May 03 2019 at 08:39):
use the instructions here - http://build.fhir.org/validation.html#jar
Pieter Edelman (May 03 2019 at 09:32):
Hi @Grahame Grieve , thanks for the pointer. This build version seems to work (I see that -defn is dropped here).
However, I think the STU3 version of the 'Validating Resources' (http://hl7.org/fhir/STU3/validation.html) page contains an error. In the batch script listing, a pointer is provided to a version which seems compatible with the other examples (http://hl7.org/fhir/STU3/validator.zip). However, the 'Download' link in the text refers to the STU3 version of the Downloads page (http://hl7.org/fhir/STU3/downloads.html), which in turn points to the general landing page of the validator (http://wiki.hl7.org/index.php?title=Using_the_FHIR_Validator), where you can only download the latest snapshot - which isn't compatible.
Grahame Grieve (May 03 2019 at 09:35):
what isn't compatible?
Pieter Edelman (May 03 2019 at 09:38):
The instructions on the STU3 'Validating Resources' page and the latest snapshot of the validator
Grahame Grieve (May 03 2019 at 09:41):
ah no. you have to use the instructions on the wiki page, not the instructions on the R3 page
Pieter Edelman (May 03 2019 at 10:36):
I understand, but that's a bit confusing. The page header states that 'This page is part of FHIR STU 3 (v3.0.1) in it's permanent home', so one (well, me ;) ) expects to find instructions here for validating STU3 resources. Maybe the 'Download' link can be changed to the 'old' STU3 snapshot at http://hl7.org/fhir/STU3/validator.zip?
Grahame Grieve (May 03 2019 at 11:38):
the old validator is not maintained and doesn't always work
Grahame Grieve (May 03 2019 at 11:38):
and is wrong too
Grahame Grieve (May 03 2019 at 11:38):
but you are right that the current arrangement is confusing
Last updated: Apr 12 2022 at 19:14 UTC