Skip to content

javax.xml.bind.DatatypeConverter unavailable warning logged at startup - JAXB dependency provides jakarta.xml.bind package instead #78

Description

@danielgentes

Hey there,

On startup, the SDK logs the following warning:

WARNING: JAXB is unavailable. Will fallback to SDK implementation which may be less
performant. If you are using Java 9+, you will need to include javax.xml.bind:jaxb-api
as a dependency.

This originates from the static initializer in Base64.java, which performs a Class.forName("javax.xml.bind.DatatypeConverter") check to decide whether it can delegate base64 encoding to JAXB's DatatypeConverter, or must fall back to the SDK's internal Base64Codec implementation.

Root cause:
ibm-cos-java-sdk-core's 2.15.1 pom.xml declares com.sun.xml.bind:jaxb-core:2.3.0.1 and com.sun.xml.bind:jaxb-impl:2.3.9 as dependencies. However, jaxb-impl:2.3.9 transitively pulls in jakarta.xml.bind:jakarta.xml.bind-api:2.3.3 - which exposes classes under the jakarta.xml.bind package, not the legacy javax.xml.bind package. As a result, javax.xml.bind.DatatypeConverter is never present on the classpath, regardless of which JAXB artifacts are bundled, and the Class.forName check always fails on Java 9+ (where the JDK no longer ships the built-in java.xml.bind module).

Thank you very much!

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