NoSuchMethodError CharBuffer.flip() using java 8 with spring boot and APM 1.0.0

(Jettro Coenradie) #1

Hi I want to play around with APM and used a spring boot application to play around. However, I get this exception. I am running on a mac with jdk 8. Any idea what I am doing wrong?

java.lang.NoSuchMethodError: java.nio.CharBuffer.flip()Ljava/nio/CharBuffer;
	at co.elastic.apm.util.IOUtils.readUtf8Stream( ~[?:?]
	at org.elasticsearch.client.RestClient.performRequest( ~[elasticsearch-rest-client-6.3.0.jar:6.3.0]
	at org.elasticsearch.client.RestClient.performRequest( ~[elasticsearch-rest-client-6.3.0.jar:6.3.0]
	at org.elasticsearch.client.RestHighLevelClient.performRequest( ~[elasticsearch-rest-high-level-client-6.3.0.jar:6.3.0]
	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity( ~[elasticsearch-rest-high-level-client-6.3.0.jar:6.3.0]

(Felix Barnsteiner) #2

Hi and thanks a lot for reporting this.

That's a very strange one. In Java 9, CharBuffer overrides the Buffer#flip method which returns a CharBuffer. In Java 8, it does override the method but the method still exists in the superclass Buffer but that one has a different return type than the class it was compiled against.

Long story short, I'll do a bugfix release shortly and sorry for the inconvenience.


(Felix Barnsteiner) #3

To fix the error right now, you can disable the elasticsearch-restclient instrumentation:

(Felix Barnsteiner) #4

The fix is implemented:

(Jettro Coenradie) #5

Thanks for your fast response, will try your suggestion.

(Felix Barnsteiner) #6

I have release 1.0.1 which fixes this issue. Thanks a lot for reporting and keep up the feedback :slight_smile:

(system) #7

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.