--- Thomas DeWeese <[EMAIL PROTECTED]> wrote: > Hmm you might try making the following change in batik.bridge.Messages > > < new LocalizableSupport(RESOURCES); > -- > > new LocalizableSupport(RESOURCES, Messages.class.getClassLoader()); > > I'd be interested to see if that fixes it...
I haven't tried it yet, but the mere existence of the classloader as an optional parameter explains a lot. I took a look at code for org.apache.batik.i18n.LocalizableSupport. As you noted it has two forms of constructor, one with a classLoader parameter and one without. The one without calls the one with, but sets the classLoader to null. The following code snippet is found several times in the getBundle method: ----------- if (classLoader == null) { resourceBundle = ResourceBundle.getBundle(bundleName, usedLocale); } else { resourceBundle = ResourceBundle.getBundle(bundleName, usedLocale, classLoader); } ----------- When java.util.ResourceBundle is called without a classLoader, it sets the classLoader to "this.getClass().getClassLoader()". So if the Batik jars are loaded with a different classloader, then they won't be visible, which explains exactly what I'm seeing. Perhaps an additional improvement would be to have the org.apache.batik.i18n.LocalizableSupport constructor set an unspecified classLoader to LocalizableSupport.class.getClassLoader() and eliminate all the if logic above. Although the Messages classLoader is the definitive one, (hypothetically you could load batik-bridge.jar differently than batik-util.jar), it's still a much safer choice (and cleaner) to be explicit, since who knows how many other things also don't specify the classLoader properly when they call LocalizableSupport. It's much more likely that a generic batik resource will be loaded with the same classLoader as batik's LocalizableSupport than java.util.ResourceBundle. Thanks so much for your help... __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]