Closed steverao closed 6 days ago
Could you try with the latest version of Byte Buddy? I do not support older releases.
Could you try with the latest version of Byte Buddy? I do not support older releases.
I searched source code of 1.14.14
:
private static void install(AttachmentProvider attachmentProvider, String processId, String argument, AgentProvider agentProvider, boolean isNative) {
......
}
protected interface AgentProvider {
......
}
Because, the parameter of AgentProvider
is protected, so it seems can't be invoked in personal application directly.
Not sure how this relates? Why are you attaching if you already specify the agent?
I encountered a problem when using ByteBuddy by jar. I add following dependencies:
And using following codes to instrument some specific classes in my app:
In the running environment, I will set environment variable of JAVA_TOOL_OPTIONS="-javaagent:A.jar -javaagent:B.jar" for my application. It's very necessary for me to do it. For some reasons, I won’t go into details. But I found at beginning phase of application, besides app's process, there is a ByteBuddy process like: Because of JAVA_TOOL_OPTIONS="-javaagent:A.jar -javaagent:B.jar", it will start with two Java Agent. they will cause the process of ByteBuddy can't finish task normally and cause my main thread will also be blocked:
I debug the it and found the core problem is that there is a conflict when the ByteBuddy process mounts Java Agent A and B. I wonder if there is a way to add the JAVA_TOOL_OPTIONS="" parameter to the ByteBuddy startup process in the code to solve this problem?