This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git
The following commit(s) were added to refs/heads/main by this push:
new 42ea174ed Force the injected high-priority classes in order to avoid
NoClassDefFoundError. (#292)
42ea174ed is described below
commit 42ea174ed9fbacf8e82f415dcf8fe7004729a8f6
Author: Jeffrey H. Lei <[email protected]>
AuthorDate: Tue Aug 16 17:40:47 2022 +0800
Force the injected high-priority classes in order to avoid
NoClassDefFoundError. (#292)
Co-authored-by: leihuazhe <[email protected]>
---
CHANGES.md | 1 +
.../apm/agent/core/plugin/bootstrap/BootstrapInstrumentBoost.java | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
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<String, byte[]> classesTypeMap = new HashMap<>();
+ Map<String, byte[]> classesTypeMap = new LinkedHashMap<>();
if (!prepareJREInstrumentation(pluginFinder, classesTypeMap)) {
return agentBuilder;