FHIR Chat · Java CQL Engine Error · cql

Stream: cql

Topic: Java CQL Engine Error


view this post on Zulip Benjamin Langley (May 12 2020 at 19:32):

Hello all,
I'm attempting to use the Java CQL engine however I am getting an error whenever I try to access a property of a resource. For example
define CLAIM: [Claim]
will return the Claim object. But when I do something like
define CLAIM: [Claim] C return C.id.value
I get the following error

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/Users/blangley/.gradle/caches/modules-2/files-2.1/com.sun.xml.bind/jaxb-impl/2.3.0.1/2e979dabb3e5e74a0686115075956391a14dece8/jaxb-impl-2.3.0.1.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Which is coming from the line
CqlTranslator translator = CqlTranslator.fromText(this.cql, modelManager, libraryManager);

Does anyone know what is causing this or what I am doing wrong?
Thanks!

view this post on Zulip Benjamin Langley (May 12 2020 at 20:02):

Correction: that error is happening from the translator but that is not the error from attempting to access a property of a resource. That error occurs when executing the CQL:

Servlet.service() for servlet [dispatcherServlet] in context with path [/fhir] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: ca/uhn/fhir/context/BaseRuntimeChildDefinition$IAccessor.getValues(Lorg/hl7/fhir/instance/model/api/IBase;)Ljava/util/List; (loaded from file:/Users/blangley/.gradle/caches/modules-2/files-2.1/ca.uhn.hapi.fhir/hapi-fhir-base/3.7.0/e31584e480341990c3faa6833782922106a77cef/hapi-fhir-base-3.7.0.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@a8cf518a) called from class org.opencds.cqf.cql.model.FhirModelResolver (loaded from file:/Users/blangley/.gradle/caches/modules-2/files-2.1/org.opencds.cqf/cql-engine-fhir/1.3.12.1/e97627594b257806e4d0c89fe8274fd4f4941ff8/cql-engine-fhir-1.3.12.1.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@a8cf518a).] with root cause

java.lang.NoSuchMethodError: ca/uhn/fhir/context/BaseRuntimeChildDefinition$IAccessor.getValues(Lorg/hl7/fhir/instance/model/api/IBase;)Ljava/util/List; (loaded from file:/Users/blangley/.gradle/caches/modules-2/files-2.1/ca.uhn.hapi.fhir/hapi-fhir-base/3.7.0/e31584e480341990c3faa6833782922106a77cef/hapi-fhir-base-3.7.0.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@a8cf518a) called from class org.opencds.cqf.cql.model.FhirModelResolver (loaded from file:/Users/blangley/.gradle/caches/modules-2/files-2.1/org.opencds.cqf/cql-engine-fhir/1.3.12.1/e97627594b257806e4d0c89fe8274fd4f4941ff8/cql-engine-fhir-1.3.12.1.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@a8cf518a).
at org.opencds.cqf.cql.model.FhirModelResolver.resolveProperty(FhirModelResolver.java:334) ~[cql-engine-fhir-1.3.12.1.jar:na]
....

view this post on Zulip Bryn Rhodes (May 12 2020 at 23:03):

Hi @Benjamin Langley , are you running this inside a ruler? Or standalone? What version of FHIR are you using in the CQL?

view this post on Zulip Benjamin Langley (May 13 2020 at 12:44):

@Bryn Rhodes I am running stand alone using FHIR 4.0.0

view this post on Zulip Bryn Rhodes (May 14 2020 at 04:20):

Can you try this with the 1.4.0-SNAPSHOT?

view this post on Zulip Bryn Rhodes (May 14 2020 at 04:28):

No, wait, looking at that stack, it looks like you're loading the 3.7 version of HAPI, but the 1.3.12.1 engine was built with HAPI 4.1, so you'll need at least that version to run


Last updated: Apr 12 2022 at 19:14 UTC