|
[
Permlink
| « Hide
]
Marcin Owsiany added a comment - 07/Oct/05 05:09 AM
Oops, forgot to note that this was with jdo-1.0.2.jar
I am surprised that the I18NHelper would ever get the bootstrap class loader passed as an argument. I thought that the bootstrap class loader was used only for java.lang classes and system extensions which (I thought) should never be the class loader passed to the I18NHelper.
Aha! Did you put the JDO implementation jar files into a system extension? I put the kodo jars and the jdo-1.0.2.jar in $CATALINA_HOME/common/endorsed/
I adapted the patch to the apache versions of the code line. This patch applies to both the api11 and the api20 projects.
Please review. Thanks, Craig The patch calls ResourceBundle.getBundle(bundleName, locale) if the specified class loader is null. This calls getBundle with the caller's class loader, in this case the class loader that loaded I18NHelper.
I'm not sure whether this is the right class loader. Instead we could use the system class loader, if the specified class loader is null: if (loader == null) { loader = ClassLoader.getSysytemClassLoader(); } messages = ResourceBundle.getBundle(bundleName, locale, loader); I agree with Michael that the appropriate class loader is the system class loader (since clearly the bootstrap class loader is not accessible as an instance). The only catch is that the getSystemClassLoader is protected by security and needs to be called in a doPrivileged block.
I'll see how to incorporate this information into the patch. This patch applies at the "trunk" level. It includes a new method getSystemClassLoaderPrivileged that is used to load the bundle in case the class loader passed to loadBundle is null.
Patch 2 was committed to both api11 and api20 repositories.
Committed version 326164. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||