Hi,

till Java 8 JAXB was part of the JDK, the version included in JDK8 is 2.2.8. 
Starting with Java 9, JAXB was removed from the JRE and has to be added as a 
separate library (the version that comes with Karaf 4.2.8 is 2.3.2).

I am currently working on the same problem, because we are trying to run some 
Jackson-xml component which requires JAXB 2.3.0 or later. My tests are not 
entirely finished, but in theory (and my tests justify this so far) the 
following approach should work:

1. copy the following files from lib/jdk9plus to lib/endorsed: 
    istack-commons-runtime-3.0.10.jar, 
    jakarta.xml.bind-api-2.3.2.jar, 
    jaxb-runtime-2.3.2.jar, 
   txw2-2.3.2.jar
2. edit the file etc/jre.properties. There is a section starting with jre-1.8. 
In this section you have some exports for javax.xml.bind with version 2.2.8. 
Change that version to 2.3.0 (as in the jre-9 section)

The first step actually replaces the JAXB runtime in the JDK with the one from 
the external library with the JDK 8 endorsed mechanism. The second step changes 
the version of the exported JAXB packages to a newer version (which makes your 
first change known to the OSGi framework).

Best regards
Stephan

-----Original Message-----
From: Łukasz Dywicki <[email protected]> 
Sent: Dienstag, 28. April 2020 12:06
To: [email protected]; lechlukasz <[email protected]>
Subject: Re: Other version of javax.xml.bind when running with Java 8 and 11

Cześć Łukasz,
Technically speaking JAXB as a standard is moving its versions so
version shipped with Java 8 and Java 11 will be different. As far I
remember the overall plan for future releases is to remove JAXB from
official distribution and let programmers manage it as external dependency.
You can install RI within framework at the cost of additional megabyte
of your distribution.

Best regards,
Łukasz
--
Code-House
http://code-house.org


On 28.04.2020 09:50, lechlukasz wrote:
> Hello,
> 
> Is there a technical reason for org.apache.felix.framework providing other
> version of javax.xml.bind package when running with Java 8 (2.2.8) and Java
> 11 (2.3.0)?
> 
> Best regards,
> Lukasz Lech
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

Reply via email to