Stream: implementers
Topic: Schema not found
Mordekhai Oziel (May 11 2017 at 11:56):
Hi,
when I call the validateWithResult method at runtime I get the following error: ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Schema not found. Note that as of HAPI FHIR 1.2, DSTU2 validation files are kept in a separate JAR (hapi-fhir-validation-resources-XXX.jar) which must be added to your classpath.
Here are the maven dependencies:
hapi-fhir-base: 2.4
hapi-fhir-structures-dstu: 2.4
hapi-fhir-structures-dstu2: 2.4
phloc-schematron: 2.7.1
phloc-commons: 4.4.6
hapi-fhir-structures-hl7org-dstu2: 2.4
hapi-fhir-validation-resources-dstu2: 2.4
I debugged and noticed that the fhir-single.xsd file is searched for inside the org/hl7/fhir/instance/model/schema . But this path is not correct for version 2.4. It is correct only for version 1.1.
On the other hand when using the 1.1 version we can't see the FhirInstanceValidator constructor which has the package visibility and not the public one.
Do you know which version should I use to be able to find the xsd schemas and the FhirInstanceValidator constructor ?
Thanks
Mordekhai Oziel (May 11 2017 at 12:30):
I can see that it works only if I use the dstu1 context. Any idea why and how to get it working for dstu 2?
Thanks
Mordekhai Oziel (May 11 2017 at 13:14):
When using hapi-fhir-validation-resources-dstu2: 2.3 everything works fine.
I hope this will help anyone else.
Last updated: Apr 12 2022 at 19:14 UTC