Hi,
I'm trying to use the latest APM Java agent (1.18) but I'm facing this error:
ERROR co.elastic.apm.agent.util.DependencyInjectingServiceLoader - unable to instantiate 'co.elastic.apm.agent.httpclient.HttpClientAsyncInstrumentation', unsupported class version error: co/elastic/apm/agent/httpclient/HttpClientAsyncInstrumentation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
to be honest, I read articles and searched it also here but...is there anyone can help me to understand it and explain it? I mean, can I fix it anyway?
is it an error that can I ignore or not?
Thanks for the feedback @felixbarny. Does that then mean it is not a problem? and the deployment should work successfully
I have exactly the same issue in my deployment. APM agent is able to successfully run healthchecks against the APM Server, but never posts events successfully to the apm server. when it attempts to post a /intake/v2/events call, it always fails with
java.io.IOException: Error writing request body to serve
If you check the communication between the agent and the server with a tcpdump, you would notice the agent never sent anthing over the wire to the apm server. What do you think? i have actually logged the issue here
If I use a version greater than 4.5.1 for JNA the APM agent does not work, with the following error
[INFO] Attaching agents: [] Exception in thread "main" java.lang.IllegalStateException: Error during attachment using: co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound@dbd940d
** at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:613)**
** at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:273)**
** at co.elastic.apm.attach.ElasticApmAttacher.attach(ElasticApmAttacher.java:159)**
** at co.elastic.apm.attach.ElasticApmAttacher.attach(ElasticApmAttacher.java:113)**
** at co.elastic.apm.attach.ElasticApmAttacher.attach(ElasticApmAttacher.java:70)**
** at local.proxy.SecDNS.SecDnsApplication.main(SecDnsApplication.java:46)** Caused by: java.lang.reflect.InvocationTargetException
** at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)**
** at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)**
** at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)**
** at java.lang.reflect.Method.invoke(Method.java:498)**
** at co.elastic.apm.attach.bytebuddy.agent.Attacher.install(Attacher.java:106)**
** at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:608)**
** ... 5 more** Caused by: java.lang.NoSuchFieldError: SIZE
** at com.sun.jna.platform.win32.WinBase.(WinBase.java:52)**
** at com.sun.jna.platform.win32.WinNT$HANDLE.fromNative(WinNT.java:1366)**
** at com.sun.jna.NativeMappedConverter.fromNative(NativeMappedConverter.java:70)**
** at com.sun.jna.Function.invoke(Function.java:370)**
** at com.sun.jna.Library$Handler.invoke(Library.java:265)**
** at com.sun.proxy.$Proxy2.OpenProcess(Unknown Source)**
** at co.elastic.apm.attach.bytebuddy.agent.VirtualMachine$ForHotSpot$Connection$ForJnaWindowsNamedPipe$Factory.connect(VirtualMachine.java:1271)**
** at co.elastic.apm.attach.bytebuddy.agent.VirtualMachine$ForHotSpot.attach(VirtualMachine.java:256)**
** at co.elastic.apm.attach.bytebuddy.agent.VirtualMachine$ForHotSpot.attach(VirtualMachine.java:239)**
** ... 11 more**
If I use version 4.5.1 for JNA, the APM agent works but with the following errors:
2020-10-06 19:31:25,426 [Attach Listener] INFO co.elastic.apm.agent.util.JmxUtils - Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean
2020-10-06 19:31:25,446 [Attach Listener] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.18.0 as SecurityProxyApplication on Java 1.8.0_261 Runtime version: 1.8.0_261-b12 VM version: 25.261-b12 (Oracle Corporation) Windows 10 10.0 > 2020-10-06 19:31:25,476 [Attach Listener] ERROR co.elastic.apm.agent.util.DependencyInjectingServiceLoader - unable to instantiate 'co.elastic.apm.agent.httpclient.HttpClientInstrumentation', unsupported class version error: co/elastic/apm/agent/httpclient/HttpClientInstrumentation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 > 2020-10-06 19:31:25,476 [Attach Listener] ERROR co.elastic.apm.agent.util.DependencyInjectingServiceLoader - unable to instantiate 'co.elastic.apm.agent.httpclient.HttpClientAsyncInstrumentation', unsupported class version error: co/elastic/apm/agent/httpclient/HttpClientAsyncInstrumentation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 > 2020-10-06 19:31:25,477 [Attach Listener] ERROR co.elastic.apm.agent.util.DependencyInjectingServiceLoader - unable to instantiate 'co.elastic.apm.agent.httpclient.HttpRequestHeadersInstrumentation', unsupported class version error: co/elastic/apm/agent/httpclient/HttpRequestHeadersInstrumentation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 > 2020-10-06 19:31:26,591 [elastic-apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available: { "build_date": "2020-09-22T22:02:35Z", "build_sha": "34f81a2208c862777ca587867fd3aa2373c3f669", "version": "7.9.2"}
2020-10-06 19:31:26,679 [elastic-apm-remote-config-poller] INFO co.elastic.apm.agent.configuration.ApmServerConfigurationSource - Received new configuration from APM Server: {}
2020-10-06 19:31:27,117 [Attach Listener] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state
Thanks for the report!
This not related to this topic though. Please create a new one or better, create an issue on the Byte Buddy repository: Issues · raphw/byte-buddy · GitHub
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.