OpenAM 16.0.3 JAXB 1.0 generated classes fail on JDK 21 — JAXBContext initialization returns null #963
Unanswered
Bisht-Mohit
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
Hi @Bisht-Mohit, Good question. We have plans to migrate to JAXB 4.x. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
We are migrating our sso fedlet library to be compatible with JDK 21 and Tomcat 10.x. As part of this migration, we upgraded from OpenAM 14.x to OpenAM 16.0.3 libraries, which are Jakarta-ized (i.e., they use the
jakarta.*namespace instead of the oldjavax.*namespace).After deploying the updated WAR on a node running JDK 21, the SSO enable test fails with:
The Service Provider entity ID is never populated because SAML metadata parsing fails silently during startup. The root cause is that OpenAM 16.0.3 performed a partial Jakarta migration while the API namespace was updated, the generated SAML implementation classes inside
openam-saml2-schema-16.0.3.jarare still JAXB 1.0-style code that depends oncom.sun.xml.bind.*classes which have been completely removed from JDK 21.To Reproduce
Expected behavior
SSO enable should succeed. The SP entity ID should be populated from the SAML metadata, and the SSO configuration wizard should proceed normally through metadata import, SSO enable, and SSO test.
Environment
jakarta.xml.bind-api-4.0.2.jar,jaxb-runtime-4.0.5.jar)Additional context
What we changed Library Upgrades
OpenAM Libraries (14.x → 16.x)
The core OpenAM libraries were upgraded from version 14.0.0-M6 to 16.0.3:
Old JARs Removed (incompatible with JDK 21)
jakarta.xml.bind-api-4.0.2.jarjaxb-runtime-4.0.5.jarxmlsec-3.0.3.jarNew JARs Added
Root Cause Analysis
OpenAM 16.0.3's Jakarta migration is incomplete:
javax.xml.bind→jakarta.xml.bindcom.sun.xml.bind.*)The generated classes inside
openam-saml2-schema-16.0.3.jarstill reference old JAXB 1.0 RI classes:These
com.sun.xml.bind.*classes were completely removed from JDK 21. Additionally, the JAXB 1.0 and 4.x approaches are fundamentally incompatible:GrammarInfoclasses describe the schema programmatically@XmlRootElement,@XmlTypeimplements JAXBObject, usesListImpl,GrammarInfoImpl@XmlRootElement,@XmlAccessorTypeSince OpenAM's generated classes follow the JAXB 1.0 style (no annotations, implements
JAXBObject), the JAXB 4.x runtime cannot understand them. It tries to scan for annotations, finds none, and throws anIllegalAnnotationsException. This causes theJAXBContextto remainnull, which means all metadata parsing fails silently, and the SP entity ID is never set.This triggered a cascade of 5 related issues, each discovered after fixing the previous one.
Question
The core issue is that OpenAM 16.0.3's internal SAML classes are still JAXB 1.0-style generated code, but the JAXB 4.x runtime on JDK 21 only supports annotation-based classes. The old JAXB 1.0 RI classes (
com.sun.xml.bind.*) that these generated classes depend on have been completely removed from modern JDKs.How do we fix this incompatibility so that the existing OpenAM 16.x JAXB 1.0-style generated classes can work on JDK 21 with Jakarta XML Binding 4.x, without modifying the OpenAM libraries themselves?
Thanks in advance,
Mohit.
Beta Was this translation helpful? Give feedback.
All reactions