You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
WangSZ
changed the title
[Question] How to advice a class that have been intercepted by another javaagent
[Question] How to advice a class that have been intercepted by another javaagent but not loaded
Mar 25, 2020
For your initial agent, you are injecting additional classes which are based on top of synthetic classes which are not resolvable as the class loader cannot read their class file representations.
If you want to write agents that are stackable, I recommend you to use Advice rather then MethodDelegation as it aims to enrich methods rather then replacing them.
Otherwise, you'd need to capture the byte code implementations you generate using an AgentBuilder.Listener and implement a ClassFileLocator that looks up these altered class files.
For your initial agent, you are injecting additional classes which are based on top of synthetic classes which are not resolvable as the class loader cannot read their class file representations.
If you want to write agents that are stackable, I recommend you to use Advice rather then MethodDelegation as it aims to enrich methods rather then replacing them.
Otherwise, you'd need to capture the byte code implementations you generate using an AgentBuilder.Listener and implement a ClassFileLocator that looks up these altered class files.
Otherwise, you'd need to capture the byte code implementations you generate using an AgentBuilder.Listener and implement a ClassFileLocator that looks up these altered class files.
Hi, I'm new to bytebuddy, is there any demo for the quote above?
No, but in the listener, in the onTransform method, you receive names and byte codes of any transformed classes within the DynamicType instance provided. You would need to extract that data and make it available via the ClassFileLocator which provides names where the byte code of the classes previously supplied to the listener would be expected in return.
[com.web.TestController] is intercepted by another javaagent and not loaded. Its not working when I advice it.
The text was updated successfully, but these errors were encountered: