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:
Hello! Thank you for reporting this and for explaining the situation in depth, this is indeed a bug and something we didn't consider, sorry for the inconvenience. While 8.16 is no longer supported and won't get a patch, all following versions of 8.17 and 8.18 will be built fully targeting Java 8 by adding these lines to our build.gradle file, as suggested in the blog post you kindly provided:
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: