Currently, APM Java agent v1.26.0 is attached successfully to a Spring Boot 2.6 application (JDK 17).
This application has enabled Java modules and is therefore running on the modulepath.
Although the APM Java Agent is not impacted to the Log4J vulnerability, we want to upgrade to the latest version (v1.28.3 atm). During start up, following exceptions are thrown abundantly:
c.e.a.a.b.b.ErrorLoggingListener : Error on transformation org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
java.lang.AbstractMethodError: Receiver class co.elastic.apm.agent.bci.bytebuddy.MinimumClassFileVersionValidator does not define or inherit an implementation of the resolved method 'abstract net.bytebuddy.jar.asm.ClassVisitor wrap(net.bytebuddy.description.type.TypeDescription, net.bytebuddy.jar.asm.ClassVisitor, net.bytebuddy.implementation.Implementation$Context, net.bytebuddy.pool.TypePool, net.bytebuddy.description.field.FieldList, net.bytebuddy.description.method.MethodList, int, int)' of interface net.bytebuddy.asm.AsmVisitorWrapper.
at net.bytebuddy@1.11.22/net.bytebuddy.asm.AsmVisitorWrapper$Compound.wrap(AsmVisitorWrapper.java:743) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.dynamic.scaffold.TypeWriter$Default$ForInlining$WithFullProcessing$RedefinitionClassVisitor.visit(TypeWriter.java:4867) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:569) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:424) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.dynamic.scaffold.TypeWriter$Default$ForInlining.create(TypeWriter.java:3918) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.dynamic.scaffold.TypeWriter$Default.make(TypeWriter.java:2192) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.dynamic.scaffold.inline.RedefinitionDynamicTypeBuilder.make(RedefinitionDynamicTypeBuilder.java:224) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:11362) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11298) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1700(AgentBuilder.java:11016) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Java9CapableVmDispatcher.run(AgentBuilder.java:11763) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Java9CapableVmDispatcher.run(AgentBuilder.java:11702) ~[byte-buddy-1.11.22.jar:na]
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) ~[na:na]
at net.bytebuddy@1.11.22/net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doPrivileged(AgentBuilder.java) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy@1.11.22/net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11240) ~[byte-buddy-1.11.22.jar:na]
at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$ByteBuddy$ModuleSupport.transform(Unknown Source) ~[na:na]
at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188) ~[na:na]
at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:541) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1090) ~[na:na]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:182) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:741) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:665) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[na:na]
When reverting to the v1.26 version, the agent attaches normally.
When running the same application on the classpath, the agent v1.28.3 attaches normally.
After more research, we suspect the error appears after following change has been applied:
We could reproduce this error when generating a new Spring Boot application (with only Spring Data Jpa and Spring MVC) and converting it to the module path.
For now, we are sticking to the latest v1.26.x Agent.