Skip to content
Snippets Groups Projects
  • Tomasz Grabiec's avatar
    c0a8e41a
    RunJava: system class loader should contain application resources · c0a8e41a
    Tomasz Grabiec authored
    
    The system classloader should have classes which were
    specified in the command line using -cp/-classpath/-jar.
    Before this change only runjava.jar was included.
    
    System class loader is queried explicitly by
    java.util.logging framework to lookup classes
    configred in logging properties file.
    
    To solve this problem a custom system classloader
    is set when starting JVM. It delegates to the application
    classloader created when java program was started.
    
    It also handles the case when a new java application
    is started within the same JVM. Such application
    should have its own view of system classes. However
    we are able to install only one system classloader
    per JVm. To solve this we start each java application
    in a separate thread and use InheritableThreadLocal
    to hold the application class loader which should be
    used as system class loader view for the thread family.
    
    Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
    c0a8e41a
    History
    RunJava: system class loader should contain application resources
    Tomasz Grabiec authored
    
    The system classloader should have classes which were
    specified in the command line using -cp/-classpath/-jar.
    Before this change only runjava.jar was included.
    
    System class loader is queried explicitly by
    java.util.logging framework to lookup classes
    configred in logging properties file.
    
    To solve this problem a custom system classloader
    is set when starting JVM. It delegates to the application
    classloader created when java program was started.
    
    It also handles the case when a new java application
    is started within the same JVM. Such application
    should have its own view of system classes. However
    we are able to install only one system classloader
    per JVm. To solve this we start each java application
    in a separate thread and use InheritableThreadLocal
    to hold the application class loader which should be
    used as system class loader view for the thread family.
    
    Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>