skywalking-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [skywalking] HendSame edited a comment on issue #3661: "java -ext.dirs" is not supported
Date Thu, 28 Jan 2021 02:28:11 GMT

HendSame edited a comment on issue #3661:

   I have a question: 
   Do you have to load the depency libs by "ExtClassLoader"?  @jackiepon31 
   "-Xbootclasspath/a:"  can  not  solve this problem?By the way ,we can use the BootstrapClassLoader
to load the them.
   We  can run the oldWay.jar  such as: 
   java -javaagent:/{skywalking-agent-dir}/skywalking-agent-abm.jar
   Maybe  multiple  jar  in one directory:
   java -javaagent:/{skywalking-agent-dir}/skywalking-agent-abm.jar
   If don't want to do that like the above 
   Just like @jackiepon31  said:
   “I suggest to add SkyWalking-agent.jar or its dirs to classpath to make the load mechanism
compatible with old packaing way instead of spring-boot fat jar.” by using the  BootstrapClassLoader
to load the them, rather than the ExtClassLoader ,is OK? @wu-sheng .Because ExtClassLoader
can't seem to do it。
    We can use "instrumentation.appendToBootstrapClassLoaderSearch(jarFile)":
   public class SkyWalkingAgent {
           private static ILog LOGGER = LogManager.getLogger(SkyWalkingAgent.class);
           public static void premain(String agentArgs, Instrumentation instrumentation) throws
PluginException {
                File basePath = AgentPackagePath.getPath();
                File classPathDictionary = new File(basePath, "classpath");
                if (classPathDictionary.exists() && classPathDictionary.isDirectory())
                       String[] jarFileNames = classPathDictionary.list((dir, name) ->
                       for (String fileName : jarFileNames) {
                           JarFile jarFile = new JarFile(classPathDictionary + "/" + fileName);
   "classpath" is a dictionary that has the jars which need  to load to  classpath;
         -- classpath
              -- 1.jar
              -- 2.jar
         -- skywalking-agent-abm.jar

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message