async-http-client icon indicating copy to clipboard operation
async-http-client copied to clipboard

JakartaEE and Java 21 issues

Open alexandernajafi opened this issue 1 year ago • 0 comments

I'm upgrading to JakartaEE and Java21 and is running into issues. I'm imorting AHC version 3.0.0.Beta3 with

implementation 'org.asynchttpclient:async-http-client:3.0.0.Beta3'

But I'm getting errors related to jakarta.activation. When I try to add a body part to a request builder, I'm getting an error:

java.lang.ArrayStoreException: arraycopy: element type mismatch: can not cast one of the elements of java.lang.Object[] to the type of the destination array, jakarta.activation.MimeTypeRegistry

It works fine when I'm adding a StringPart, but this is when I try to add a InputStreamPart in the same requestBuilder.

If I import angus-activation instead, it seems to work, but it should really not be needed.

    implementation('org.asynchttpclient:async-http-client:3.0.0.Beta3') {
        exclude group: 'com.sun.activation', module: 'jakarta.activation'
    }
    implementation 'org.eclipse.angus:angus-activation:2.0.1'

alexandernajafi avatar Feb 21 '24 07:02 alexandernajafi