On Feb 8, 2007, at 7:51 AM, Tim Ellison wrote:
Geir Magnusson Jr. wrote:
So running classlib tests w/ DRLVM w/ the change to URLClassloader
works
*except* I have one consistent problem. I get 68 errors, all the
same :
java.util.MissingResourceException: Could not load data
com.ibm.icu.impl.data.BreakIteratorRules
...
Now, we do hide the bootloader's "com.ibm.icu.", but I think all
is well
there because it's only one single class we're having a problem with.
Does anyone have any insight why this one class is problematic?
Do you see who is asking for the load? i.e. by setting a breakpoint
where you throw the CNF exception, then find it's classloader etc...
Haven't done that yet.
The impl module comments for brevity here looks like this :
protected synchronized Class<?> loadClass(String className,
boolean resolveClass) throws ClassNotFoundException {
if (this == getSystemClassLoader()) {
int index = className.lastIndexOf('.');
if (index > 0) {
String pkgName = className.substring(0, index + 1);
if (pkgName.startsWith("java.") ||
pkgName.startsWith("javax.") ||
pkgName.startsWith("org.ietf.jgss.") ||
pkgName.startsWith("org.omg.") ||
pkgName.startsWith("org.w3c.") ||
pkgName.startsWith("org.xml.sax.")) {
return super.loadClass(className, resolveClass);
}
/* if we get this far, use list of verboten */
String[] verboten =
VMUtil.getAppDeniedSysloaderPackages();
The answer isn't going to change at runtime, you could pull it out of
the loop since we want loads to be as fast as possible.
I was going to pull it out to a static, but it's not actually in the
loop.
for (String pkg : verboten) {
if (pkgName.startsWith(pkg)) {
throw new ClassNotFoundException();
Add className arg to show which is being denied.
Y
}
}
}
}
return super.loadClass(className, resolveClass);
}
Where VMUtil.getAppDeniedSysloaderPackages() (a name I will change
before checkin) returns :
deniedList = {
"mx4j.",
"org.apache.bcel.",
"com.ibm.icu.",
"com.ibm.icu4jni",
"org.apache.xalan",
"org.apache.xml",
"org.apache.xpath"};
Consider adding all the trailing periods, though in these cases you
are
probably safe.
That was the intent - pds everywhere for accuracy...
geir
Regards,
Tim