Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6559097
Votes 0
Synopsis (cl) set the system classloader to the module classloader
Category java:module
Reported Against
Release Fixed
State 4-Defer, bug
Priority: 3-Medium
Related Bugs
Submit Date 17-MAY-2007
Description
If a module was launched, the system classloader should be set to the classloader of that module.
Posted Date : 2007-05-17 22:46:22.0
Work Around
N/A
Evaluation
The system classloader is obtained through ClassLoader.getSystemClassLoader() during JVM initialization. By the time this is invoked, the native module launcher has not yet passed along all the module launching information (e.g. module name, repository name, etc.) to the JVM. Because of the lack of information, the module classloader cannot be created on demand and to be set as the system classloader at that point.

To fix this, the native launcher code will need to be rearranged and pass the information to the JVM side as system properties, so the module classloader can be created on demand when the ClassLoader.getSystemClassLoader() is called during JVM initialization.
Posted Date : 2007-09-13 00:14:38.0

See comments.
Posted Date : 2007-09-13 00:30:07.0

I don't follow the logic. The class loader of the module being launched is not available until that module has completed initialization. Module initialization involves execution of lots of Java code, e.g. the entire networking stack in case of a URLRepository. Having the launcher native code populate something like system properties does not solve that.

If the creation of the system class loader cannot be delayed, then it should be created as a ClassLoader that initially always throws ClassNotFoundException and after the module becomes available delegates to that module class loader.

Note that this bug will also need to update the implementation of the classpath module, since currently that just delegates to the system classloader.
Posted Date : 2007-09-13 00:38:42.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang