Add JBoss support through mount agent by ModuleClassloader. (#527)

- Change the classloader to locate the agent path in AgentPackagePath, from `SystemClassLoader` to AgentPackagePath's loader.
This commit is contained in:
guoxiolong 2023-05-09 23:34:03 +08:00 committed by GitHub
parent 6e6aafe310
commit 4eb07e3c15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ Release Notes.
* [Chore] Exclude org.checkerframework:checker-qual and com.google.j2objc:j2objc-annotations
* [Chore] Exclude proto files in the generated jar
* Fix Jedis-2.x plugin can not get host info in jedis 3.3.x+
* Change the classloader to locate the agent path in AgentPackagePath, from `SystemClassLoader` to AgentPackagePath's loader.
#### Documentation

View File

@ -49,7 +49,7 @@ public class AgentPackagePath {
private static File findPath() throws AgentPackageNotFoundException {
String classResourcePath = AgentPackagePath.class.getName().replaceAll("\\.", "/") + ".class";
URL resource = ClassLoader.getSystemClassLoader().getResource(classResourcePath);
URL resource = AgentPackagePath.class.getClassLoader().getResource(classResourcePath);
if (resource != null) {
String urlString = resource.toString();