You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[358DC105] java.lang.NoSuchMethodError: java.nio.ByteBuffer.mark()Ljava/nio/ByteBuffer;
at co.elastic.clients.transport.instrumentation.OpenTelemetryForElasticsearch$OTelContext.beforeSendingHttpRequest(OpenTelemetryForElasticsearch.java:221)
at co.elastic.clients.transport.ElasticsearchTransportBase.performRequest(ElasticsearchTransportBase.java:143)
at co.elastic.clients.elasticsearch.ElasticsearchClient.search(ElasticsearchClient.java:2317)
What seems to be happening:
In Java 8, mark() implementation is inherited from java.nio.Buffer, and it seems on higher versions, java.nio.ByteBuffer has its own implementation of mark method. When compiling this code using the compiler of a higher Java version targeting 1.8, then we get this issue.
The signature we have available using version 8.0.422-amzn is: java.nio.Buffer.mark()Ljava/nio/Buffer; instead of what the library is expecting: java.nio.ByteBuffer.mark()Ljava/nio/ByteBuffer;
Can we get an oficial release using the Java 8 compiler?
The text was updated successfully, but these errors were encountered:
Java API client version
8.16.1
Java version
8.0.422-amzn
Elasticsearch Version
8.4.3
Problem description
When trying to use above configuration AND enabling capturing of search request bodies: https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/opentelemetry.html#_capture_search_request_bodies
Then you get the following exception:
What seems to be happening:
In Java 8, mark() implementation is inherited from
java.nio.Buffer
, and it seems on higher versions,java.nio.ByteBuffer
has its own implementation of mark method. When compiling this code using the compiler of a higher Java version targeting 1.8, then we get this issue.https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/ This resource was quite helpful understanding the issue.
The signature we have available using version 8.0.422-amzn is:
java.nio.Buffer.mark()Ljava/nio/Buffer;
instead of what the library is expecting:java.nio.ByteBuffer.mark()Ljava/nio/ByteBuffer;
Can we get an oficial release using the Java 8 compiler?
The text was updated successfully, but these errors were encountered: