commercetools / commercetools-sdk-java-v2

The e-commerce SDK from commercetools for Java.
https://commercetools.github.io/commercetools-sdk-java-v2/javadoc/index.html
Apache License 2.0
34 stars 15 forks source link

ClassCastException ConcurrentModificationDeleteRetryHandler #554

Closed pintomau closed 7 months ago

pintomau commented 7 months ago

Describe the bug

The following exception is thrown when using RetryHandler:

java.lang.ClassCastException: class com.commercetools.api.client.ConcurrentModificationDeleteRetryHandler cannot be cast to class java.util.concurrent.CompletableFuture (com.commercetools.api.client.ConcurrentModificationDeleteRetryHandler is in unnamed module of loader 'app'; java.util.concurrent.CompletableFuture is in module java.base of loader 'bootstrap')

To Reproduce

Trying to delete a payment that has the correct version (doesn't need retry):

RetryHandler.concurrentModification(commercetools.payments().delete(payment))
          .executeBlocking();

Screenshots/Code snippet

image

Stack information (please complete the following information):

Additional context

Potentially the this case in handle pointing to ConcurrentModificationDeleteRetryHandler.

jenschude commented 7 months ago

Nice catch. I fixed it and released 17.5.0.