FHIR Chat · HAPI FHIR validatorModule fails · implementers

Stream: implementers

Topic: HAPI FHIR validatorModule fails


view this post on Zulip Shamil Nizamov (May 10 2021 at 02:18):

@James Agnew

The following code from the example (based on 12.3.12 Recipe: Supplying Custom Definitions):

FhirInstanceValidator validatorModule = new FhirInstanceValidator(cache);

causes:

java.lang.NoSuchMethodError: org.hl7.fhir.validation.instance.InstanceValidator.<init>

(Lorg/hl7/fhir/r5/context/IWorkerContext;Lorg/hl7/fhir/r5/utils/FHIRPathEngine$IEvaluationContext;Lorg/hl7/fhir/r5/utils/XVerExtensionManager;) at

org.hl7.fhir.common.hapi.validation.validator.ValidatorWrapper.validate(ValidatorWrapper.java:109)

The hapi-fhir-validation-5.3.3.jar is in the Java Build Path. Am I using a wrong version?

view this post on Zulip David Pyke (May 10 2021 at 12:22):

You'll get better answers in the #hapi stream

view this post on Zulip James Agnew (May 10 2021 at 13:51):

This sounds to me like you have version conflicts on your classpath. Check that you don't have any conflicting/duplicate versions of any JARs on your classpath, including all hapi-* and all org.hl7.* ones.

view this post on Zulip Shamil Nizamov (May 10 2021 at 15:45):

OK, deleting packages one by one, but why this line of code:

FhirInstanceValidator validatorModule = new FhirInstanceValidator(cache);

asks for R5, though all structures are about R4.

Am I correct that HAPI FHIR actually converts to R5 before validating?
With R5 related JARs added to the path it goes further, which is good, but not I'm stuck with:

java.lang.NoSuchMethodError: org.hl7.fhir.utilities.Utilities.isDecimal(Ljava/lang/String;Z)Z
    at org.hl7.fhir.r5.utils.FHIRPathEngine.processConstant(FHIRPathEngine.java:1192)

even though the org.hl7.fhir.r4-5.3.11.jar and org.hl7.fhir.r5-5.3.11.jar are in the build path.


Last updated: Apr 12 2022 at 19:14 UTC