RFR: 8160950 Agent JAR added to app class loader rather than system class loader when running with -Djava.system.class.loader

Alan Bateman Alan.Bateman at oracle.com
Thu Sep 8 07:38:38 UTC 2016



On 08/09/2016 08:22, David Holmes wrote:
> Hi Serguei,
>
> On 8/09/2016 5:27 AM, serguei.spitsyn at oracle.com wrote:
>> Please, review the fix for:
>>   https://bugs.openjdk.java.net/browse/JDK-8160950
>>
>> Webrev:
>>
>> http://cr.openjdk.java.net/~sspitsyn/webrevs/2016/jdk/8160950-JLI-WLS.jdk2/ 
>>
>>
>>
>> Summary:
>>   When running a java application with the options
>> `-javaagent:myagent.jar -Djava.system.classloader=MyClassLoader`
>>   then the myagent.jar is added to the application class loader rather
>> than the custom system class loader.
>
> I'm confused, the "system" class loader is the "application" class 
> loader.
You can configure a system property to run with a custom system class 
loader (details in the ClassLoader javadoc). It's rarely used which is 
why this bug has been around for so long and nobody noticed. When you do 
run with a custom system class loader then it means you startup with 4 
class loaders (system, application, platform, boot).

-Alan


More information about the serviceability-dev mailing list