Results 7 comments of Amar

I tried with `new Transformer.ForAdvice().include(AgentBuilder.class.getClassLoader())` It still throws the first error.

Yes i have added it. Agent and bytebuddy both are in bootclasspath

Here is the stacktrace. ``` java.lang.IllegalStateException: Cannot resolve type description for com.test.ProcessImplAdvice at net.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:161) at net.bytebuddy.pool.TypePool$Default$WithLazyResolution$LazyTypeDescription.delegate(TypePool.java:1038) at net.bytebuddy.description.type.TypeDescription$AbstractBase$OfSimpleType$WithDelegation.getDeclaredMethods(TypeDescription.java:8231) at net.bytebuddy.asm.Advice.to(Advice.java:346) at net.bytebuddy.asm.Advice$WithCustomMapping.to(Advice.java:11887) at net.bytebuddy.agent.builder.AgentBuilder$Transformer$ForAdvice$Entry$ForUnifiedAdvice.resolve(AgentBuilder.java:3024) at net.bytebuddy.agent.builder.AgentBuilder$Transformer$ForAdvice.transform(AgentBuilder.java:2810) at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:10928) at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10866)...

I tried to give the classloader using which i loaded the class. I get No Advice found. When it print classloader.getResource as u said, it is printing proper path.

Facing the same on Server version: Apache Tomcat/9.0.58. It does not happen everytime though.

Seems like it is happening when agent's own classes are getting loaded. It is not consistent. Resolved it by excluding all agent's classes. Earlier i was excluding only bytebuddy package.

In my case, i am excluding all the agents' classes including bytebuddy( com.test.*, which includes com.test.bytebuddy.* and com.test.advice.* and com.test.util.*). Earlier i was giving com.test.bytebuddy.*