Skip to content

Client SDK: shaded JAXB runtime is not found through jaxb.properties #1185

Open

Description

@maximthomas

The client SDK (openam-clientsdk) shades org.glassfish.jaxb:jaxb-runtime and org.glassfish.jaxb:jaxb-core and relocates every org/ package to org.forgerock.openam.sdk.org.. The jaxb.properties files of the federation schema packages (com.sun.identity.saml2.jaxb.*, com.sun.identity.federation.jaxb.*, com.sun.identity.wsfederation.jaxb.* and the jaxb packages under com.sun.identity.liberty.ws) are not relocated, and the shade plugin does not rewrite .properties content, so they still name org.glassfish.jaxb.runtime.v2.ContextFactory.

JAXBContext.newInstance over those packages in the client SDK therefore fails with ClassNotFoundException: org.glassfish.jaxb.runtime.v2.ContextFactory: jakarta.xml.bind 3.0.1 ContextFinder does not fall back to another factory when the class named in jaxb.properties is missing.

This is not a regression of #1023. Before it, the same files named com.sun.xml.bind.ContextFactory_1_0_1, which the client SDK never bundled.

Possible fixes, neither verified against a built client SDK jar:

  • stop shading jaxb-runtime, jaxb-core, txw2 and istack-commons-runtime, so that they stay dependencies of the dependency-reduced POM;
  • exclude org.glassfish.jaxb.** from the org/ relocation.

Either fix should be checked by creating a JAXBContext over SAML2MetaUtils' package list with only the shaded client SDK jar on the classpath.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions