-
-
Notifications
You must be signed in to change notification settings - Fork 776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include method does not exist for Method Delegation approach #1640
Comments
|
I tried multiple things. Nothing worked for me. My Delegated class is loaded by my custom loader and my agent could not load that when http call id made. |
Well, there is two limitations:
|
The delegate class needs to be on the same class loader. |
No, that is how the JVM works, unfortunately. Advice, by default, inlines the code, this is why this is not the case here. |
Got it, one more thing |
I found this code online which tells bytebuddy where to search for the advice class:
agentBuilder.transform(
new AgentBuilder.Transformer.ForAdvice()
.include(
Utils.getBootstrapProxy(),
Utils.getAgentClassLoader(),
Utils.getExtensionsClassLoader())
.withExceptionHandler(ExceptionHandlers.defaultExceptionHandler())
.advice(methodMatcher, adviceClassName));
I verified and this works fine when working with advice.
In my case, I am using MehtodDelegation and want the same functionality (similar method like 'include'). I want to explicitly tell bytebuddy where to look for intercepted classes. But, I couldn't find similar thing in MethodDelegation.
Is there something that I am missing, or is there any other approach I can follow?
I want to bypass the default class loading hierarchy and want byte buddy to search for classes in my custom class loaders.
The text was updated successfully, but these errors were encountered: