Force the injected high-priority classes in order to avoid NoClassDefFoundError. (#292)

Co-authored-by: leihuazhe <leihuazhe@sensorsdata.cn>
This commit is contained in:
Jeffrey H. Lei 2022-08-16 17:40:47 +08:00 committed by GitHub
parent 115bcc1a3f
commit 42ea174ed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@ Release Notes.
* Upgrade gson to 2.8.9.
* Upgrade netty-codec-http2 to 4.1.79.Final.
* Fix race condition causing agent to not reconnect after network error
* Force the injected high-priority classes in order to avoid NoClassDefFoundError.
#### Documentation

View File

@ -22,7 +22,7 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.instrument.Instrumentation;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -86,7 +86,7 @@ public class BootstrapInstrumentBoost {
public static AgentBuilder inject(PluginFinder pluginFinder, Instrumentation instrumentation,
AgentBuilder agentBuilder, JDK9ModuleExporter.EdgeClasses edgeClasses) throws PluginException {
Map<String, byte[]> classesTypeMap = new HashMap<>();
Map<String, byte[]> classesTypeMap = new LinkedHashMap<>();
if (!prepareJREInstrumentation(pluginFinder, classesTypeMap)) {
return agentBuilder;