diff --git a/CHANGES.md b/CHANGES.md index 3a3a60388..b8c8d86bd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/bootstrap/BootstrapInstrumentBoost.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/bootstrap/BootstrapInstrumentBoost.java index caf5a10b2..523340a40 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/bootstrap/BootstrapInstrumentBoost.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/bootstrap/BootstrapInstrumentBoost.java @@ -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 classesTypeMap = new HashMap<>(); + Map classesTypeMap = new LinkedHashMap<>(); if (!prepareJREInstrumentation(pluginFinder, classesTypeMap)) { return agentBuilder;