`IndyBootstrapDispatcher` cannot be properly loaded in the Resin environment
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- java
調査の方向性
まず、$RESIN_HOME/bin/httpd.sh、resin.conf の JVM 引数、vulns.war のセットアップを使って失敗を再現します。resin.jar 内の com.caucho.boot.WatchdogProcess#createProcess と、Resin 3 の tree-node クラスローディングパスを読み、その期待される java/lang/IndyBootstrapDispatcher.class エントリと shaded agent のパスを比較します。Resin がクラスをロードし、エージェント機能が動作すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When starting Resin 3 using the provided startup script ($RESIN_HOME/bin/httpd.sh), the runtime is unable to load java.lang.IndyBootstrapDispatcher via the DynamicClassLoader.
After some investigation, I found that the startup script ultimately calls the com.caucho.boot.WatchdogProcess#createProcess method (located in resin.jar) to launch Resin. This method hardcodes the startup argument -Djava.system.class.loader=com.caucho.loader.SystemClassLoader, which replaces the default system class loader.
As a result, when Resin tries to load IndyBootstrapDispatcher, the DynamicClassLoader delegates the loading to SystemClassLoader, which is unable to load it. In Resin 3, the resin.conf file provides a tree-node element to configure special JAR file paths, allowing SystemClassLoader to access the target files. However, the internal implementation is hardcoded to fetch the target entry from the JAR file, like configuredJars.getJarEntry("java/lang/IndyBootstrapDispatcher.class").
The issue is that Elastic has shaded the class, and its actual resource path is represented as agent/bootstrap/java/lang/IndyBootstrapDispatcher.esclazz. This mismatch causes the class loading to fail, leading to malfunctioning agent functionality.
All the above is specific to Resin 3. Resin 4 might have the same problem, but I haven't tested it yet.
Steps to reproduce
- In the resin.conf file, add the following configuration
<jvm-arg>-javaagent:/path/to/elastic-apm-agent.jar</jvm-arg>
<jvm-arg>-Delastic.apm.log_level=DEBUG</jvm-arg>
<jvm-arg>-Delastic.apm.log_file=/path/to/logs/elastic-apm-agent.log</jvm-arg>
- download the vulns.jar to
$RESIN_HOME/webapps - RUN
$RESIN_HOME/bin/httpd.sh start - Access
http://localhost:7040/vulnsthrough your browser
- 主要言語
- Java
- スター
- 593
- フォーク
- 339
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
elastic/apm-agent-java のほかの issue
-
Spring MVC View instrumentation incorrectly matches static render overloads (EasyPOI)対応中かも @VelpulaGangavardhan が 5 日前に担当しました。 オープンagent-java community triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elastic/apm-agent-java#4594 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent-java
難易度 2/5 1〜2日 初心者へのやさしさ 62/100
elastic/apm-agent-java#2844 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Improve docs and add error log related to illegal activation of transaction対応中かも @AzazelSensei が 43 日前に担当しました。 オープンdocs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
elastic/apm-agent-java#850 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Log4j 2.7 log correlation calls ThreadContext.removeAll, which was introduced in 2.8対応中かも @Anshuman-Prakash が 2 日前に担当しました。 オープンagent-java community triage
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
elastic/apm-agent-java#4593 ·
メンテナーはふだん 1 日以内に返信
-
agent-java community triage
elastic/apm-agent-java#4573 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
elastic/apm-agent-java の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
quarkusio/quarkus-agent-mcp#296 ·
メンテナーはふだん 1 日以内に返信
-
enhancement web-ui
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
jenkinsci/jenkins#27583 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/rocketmq-dashboard#7302 ·
メンテナーはふだん 3 日以内に返信
-
area: android good first issue help wanted testing
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Gautam-aman/ResQNet#56 ·
メンテナーはふだん 1 日以内に返信