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!
Hey there,
On startup, the SDK logs the following warning:
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!