commercetools/commercetools-sdk-java-v2

Fails to run with Java 17 Spring Boot 3

milindsingh opened this issue · 1 comments

Describe the bug
With Spring Boot 3 javax.* is replaced with jakarta.* resulting in unit test failure due to dependency conflict in project and sdk.
Error: NoClassDefFound javax/xml/bind/annotation/XmlElement

To Reproduce
Run the below code in project:

  objectMapper.findAndRegisterModules();
    ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    objectMapper.readValue(data, tClass);

Expected behavior
SDK should use the latest jakarta dependencies.

Screenshots/Code snippet
Error: NoClassDefFound javax/xml/bind/annotation/XmlElement

Stack information (please complete the following information):

  • Java: 17
  • SDK: 14.3 latest

Additional context
NA

It's not an issue of the SDK. We don't use the XmlElement annotation.

The incompatibility comes from Jackson in combination with Spring Boot 3. You will have to find some working combination by excluding and/or explicitly referencing the needed dependencies.