Skip to content

Commit

Permalink
Client with Java 8 runtime and Apache HttpClient 5 Transport fails wi…
Browse files Browse the repository at this point in the history
…th java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta committed Apr 5, 2024
1 parent 766b6ec commit 635081d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.opensearch.client.transport.httpclient5.internal;

import java.io.IOException;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
Expand Down Expand Up @@ -140,7 +141,7 @@ public void produce(final DataStreamChannel channel) throws IOException {
}
}
if (byteBuffer.position() > 0) {
byteBuffer.flip();
((Buffer)byteBuffer).flip();
channel.write(byteBuffer);
byteBuffer.compact();
}
Expand Down

0 comments on commit 635081d

Please sign in to comment.