Java APM Client Spring ClaassLoading Issue

I try to update the apm agent from 1.17.0 to 1.18.1.

But get the error below: (The same error occurs with 1.18.0 as well.)

Hi @suikast42,

It seems that bytecode modification applied by the agent may cause this error.
Is it reproducible systematically ?

Can you try to start the agent with log_level=debug and give us the name of the instrumentation classes that are applied to this method ? using cat agent.log | grep 'StcRepository' | grep 'Method match'

Also, can you provide the exact JVM version and vendor that you are using ? (output of java -version would provide this).

Also, what could help here would be to get the modified bytecode for this class, you can instruct the agent to dump that to filesystem by:

  • creating a temporary folder /tmp/bytebuddy-dump
  • add -Dco.elastic.apm.agent.shaded.bytebuddy.dump=/tmp/bytebuddy-dump to your JVM options

Then, if that particular class is modified by our agent, there should be multiple versions of that class suffixed with timestamp in the /tmp/bytebuddy-dump folder, you can attach those so we can analyze what could be wrong here.