Open brynrhodes opened 1 year ago
Same issue as #428 as I'm facing this error when trying to build the ModelInfo. This seems to be due to an now outdated library that we rely on.
java.lang.LinkageError: loader constraint violation: when resolving field "DATETIME" of type javax.xml.namespace.QName, the class loader org.codehaus.mojo.exec.URLClassLoaderBuilder$ExecJavaClassLoader @6ddee60f of the current class, org.glassfish.jaxb.runtime.v2.model.impl.RuntimeBuiltinLeafInfoImpl, and the class loader 'bootstrap' for the field's defining type, javax.xml.datatype.DatatypeConstants, have different Class objects for type javax.xml.namespace.QName (org.glassfish.jaxb.runtime.v2.model.impl.RuntimeBuiltinLeafInfoImpl is in unnamed module of loader org.codehaus.mojo.exec.URLClassLoaderBuilder$ExecJavaClassLoader @6ddee60f, parent loader 'app'; javax.xml.datatype.DatatypeConstants is in module java.xml of loader 'bootstrap')
When a profile changes cardinality of a plural element to singular, the ModelInfo outputs the element in the profile as a singular element, rather than as a List of elements. This results in run-time errors because the underlying classes still have the plural modeling based on the ancestor profile and ultimately resource definition.
The issue was reported on the translator here (for QICore 4.1.1): https://github.com/cqframework/clinical_quality_language/issues/1136
The issue was addressed there by manually updating the MedicationNotRequested.reasonCode element to be plural, but the tooling in general should not reduce cardinality of derived elements to avoid this runtime issue.