jmxtrans / jmxtrans-agent

Java Agent based JMX metrics exporter.
MIT License
177 stars 110 forks source link

Got java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip() testing the version 1.2.11-rc-2 #155

Closed endoplasmicR closed 3 years ago

endoplasmicR commented 3 years ago

When testing the version 1.2.11-rc-2

We saw an exception triggered from https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/StatsDOutputWriter.java#L231

The root cause is exactly https://stackoverflow.com/questions/61267495/exception-in-thread-main-java-lang-nosuchmethoderror-java-nio-bytebuffer-flip

which JDK version was used to compile and release into maven? if possible, can we add the --release 8 flag to avoid the issue

cyrille-leclerc commented 3 years ago

Thanks @endoplasmicR for the fix https://github.com/jmxtrans/jmxtrans-agent/commit/66c8e01991169bbb667ff5f51a766445cdbdb068

Can you please test v1.2.11-rc-3 ?

endoplasmicR commented 3 years ago

Thanks for merging! I have just test it again and still got the same error, i have tried a different fix and looks like it got it resolved. sending a PR now

endoplasmicR commented 3 years ago

The fix is in PR: https://github.com/jmxtrans/jmxtrans-agent/pull/157 this should ensure cross version compatibility

cyrille-leclerc commented 3 years ago

Fix in https://github.com/jmxtrans/jmxtrans-agent/releases/tag/jmxtrans-agent-1.2.1