Uses an unsupported class file version (pre Java 5) and can't be instrumented. Consider updating to a newer version of that library

Context: I want to see logs by apm-agent, but only log i find is below

[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - com.mchange.v2.c3p0.impl.NewProxyCallableStatement uses an unsupported class file version (pre Java 5) and can't be instrumented. Consider updating to a newer version of that library.

Kibana version: 7.5.2

Elasticsearch version: 7.5.2

APM Server version: 7.5.2

APM Agent language and version: java

Original install method (e.g. download page, yum, deb, from source, etc.) and version: ECK operator

I adding the elastic apm agent jar to my spring boot app which is complied in jdk 8. and verison of apm-agent iscomplied in jdk 10. is the above error realted to different jdk versions ?
If so can i add the jar as maven dependecy and compile using jdk 8? I see in kibana not to add apm-agent as dependency

Hello Kumar,

That error is independent from the version difference between your code and the agent jar. The agent uses ByteBuddy to dynamically create ByteCode and inject it. This Library requires that ALL libraries are compiled using Java 5 or later and it seems your c3p0 jar is compiled with an earlier version. Upgrading this jar file to a newer version should do the trick.

Best regards
Wolfram

1 Like

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