apache / apache/camel-quarkus

FHIR: java.lang.LinkageError (javax.xml.namespace.QName)

Open
#5,561 2 comments 0 reactions 1 assignee Claimed by @jamesnetherton View on GitHub
area/core area/fhir area/native bug native
Dominant language
Java
Stars
302
Forks
232
Avg merge
1d 20h
Merged PRs (30d)
114

Description

### Bug description

Recent camel upgrade https://github.com/apache/camel/commit/d0eb12c68a8ccc343ef1c0a37620b5f7168225f0
changed `ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may` from 6.0.1 to 6.1.2.2.
This change brought transitive dependency `org.ogce:xpp3:jar:1.1.6` which contains class `javax.xml.namespace.QName`
The same class exists in core java

Therefore the following error is thrown during execution of Fhir tests `FhirR4Test#marshalUnmarshal`.

```
Caused by: java.lang.LinkageError: loader constraint violation: loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @5423a17 wants to load class javax.xml.namespace.QName. A different class with the same name was previously loaded by 'bootstrap'. (javax.xml.namespace.QName is in module java.xml of loader 'bootstrap')
```

The fact that the error happens only for 1 test means, that the code is really used by that test.
So as a quick solution I excluded `org.ogce:xpp3` in the bom - https://github.com/apache/camel-quarkus/blob/camel-main/poms/bom/pom.xml#L6039-L6042

Both JVM and native tests succeed with such exclusion. Therefore the "quick fix" seems to be correct.

I doubt a little bit, whether another slightly different configuration can be used, which could bring a failure due to different class.

The class from `org.ogce:xpp3` contains 1 method, which is not part of the class from java:

```
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
this.namespaceURI = this.namespaceURI.intern();
this.localPart = this.localPart.intern();
this.prefix = this.prefix.intern();
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.