JAXBException while trying to start Gerrit 3.5.2 in openjdk 11

64 views
Skip to first unread message

motorhe...@gmail.com

unread,
Nov 5, 2024, 2:09:21 PM11/5/24
to Repo and Gerrit Discussion
We are trying to update a Gerrit 3.2.7 instance to Gerrit 3.5.2.

We understand that Gerrit 3.5 requires openjdk 11, and so we have installed openjdk 11 and made it default (using update-alternatives) and specified the appropriate path in gerrit.config under container.javaHome.

Now we get the following error when we try to run gerrit.sh start:

[2024-11-05T07:39:38.628-05:00] [main] ERROR com.google.gerrit.pgm.Daemon : Thread main threw exception
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

We understand that Jakarta XML Bindings (jaxb) library is no longer bundled with openjdk as of version 11, so this must be a familiar issue.

Trying to install jaxb in RHEL8, we got the output shown below.

We downloaded gerrit-3.5.2.war from here:
https://gerrit-releases.storage.googleapis.com/gerrit-3.5.2.war

Do we need to recmopile this version of Gerrit to include jaxb libraries? Is there another method to introduce jaxb that the system will pick it up?

Any pointers appreciated.

Regards,
Robert Gregory


$ sudo yum search jaxb-api4
Updating Subscription Management repositories.
======================= Name Exactly Matched: jaxb-api4 ========================
jaxb-api4.noarch : Jakarta XML Binding API
$ sudo yum install jaxb-api4
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - BaseOS   45 kB/s | 2.4 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - Supplem  39 kB/s | 2.1 kB     00:00
Red Hat Satellite Tools 6.6 for RHEL 8 x86_64 (  35 kB/s | 2.1 kB     00:00
AMD CUSTOM RHEL8                                 38 kB/s | 2.1 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - AppStre  55 kB/s | 2.8 kB     00:00
Dependencies resolved.
================================================================================
 Package             Arch   Version      Repository                        Size
================================================================================
Installing:
 jaxb-api4           noarch 4.0.0-2.module+el8.8.0+18042+89a504d5
                                         rhel-8-for-x86_64-appstream-rpms 121 k
Installing dependencies:
 jakarta-activation2 noarch 2.1.1-2.module+el8.8.0+18042+89a504d5
                                         rhel-8-for-x86_64-appstream-rpms  73 k

Transaction Summary
================================================================================
Install  2 Packages

Total size: 194 k
Installed size: 230 k
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] jakarta-activation2-2.1.1-2.module+el8.8.0+18042+89a504d5.noarch.rpm: Already downloaded
[SKIPPED] jaxb-api4-4.0.0-2.module+el8.8.0+18042+89a504d5.noarch.rpm: Already downloaded
Running transaction check
No available modular metadata for modular package 'jakarta-activation2-2.1.1-2.module+el8.8.0+18042+89a504d5.noarch', it cannot be installed on the system
No available modular metadata for modular package 'jaxb-api4-4.0.0-2.module+el8.8.0+18042+89a504d5.noarch', it cannot be installed on the system
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: No available modular metadata for modular package
$

Sven Selberg

unread,
Nov 6, 2024, 2:16:32 AM11/6/24
to Repo and Gerrit Discussion
On Tuesday, November 5, 2024 at 8:09:21 PM UTC+1 motorhe...@gmail.com wrote:
We are trying to update a Gerrit 3.2.7 instance to Gerrit 3.5.2.

We understand that Gerrit 3.5 requires openjdk 11, and so we have installed openjdk 11 and made it default (using update-alternatives) and specified the appropriate path in gerrit.config under container.javaHome.

Now we get the following error when we try to run gerrit.sh start:

[2024-11-05T07:39:38.628-05:00] [main] ERROR com.google.gerrit.pgm.Daemon : Thread main threw exception
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

I cannot find any reference to jakarta xml in Gerrit source-code.
Are you using jaxb in a fork or a plugin?

motorhe...@gmail.com

unread,
Nov 6, 2024, 8:02:29 AM11/6/24
to Repo and Gerrit Discussion
I think you are right. I should have removed (or at least disabled) existing plugins before attempting the upgrade.

Thank you.
Robert.
Reply all
Reply to author
Forward
0 new messages