String charset = annotationExtractor.extractCharset(locale);
// use the declaring class' loader instead of
// this.getClass().getClassLoader()
// see also http://jira.qos.ch/browse/CAL-8
CAL10NBundleFinderByClassloader cal10NBundleFinderByClassloader = new CAL10NBundleFinderByClassloader(declaringClass.getClassLoader());
CAL10NBundle rb = cal10NBundleFinderByClassloader.getBundle(
baseName, locale, charset);
if (rb == null) {
throw new MessageConveyorException(
"Failed to locate resource bundle [" + baseName