[
https://issues.apache.org/jira/browse/DELTASPIKE-386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gerhard Petracek resolved DELTASPIKE-386.
-----------------------------------------
Resolution: Fixed
Fix Version/s: 0.5
Assignee: Mark Struberg
> PropertyFileUtils.getResourceBundle() fails in EAR
> --------------------------------------------------
>
> Key: DELTASPIKE-386
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-386
> Project: DeltaSpike
> Issue Type: Bug
> Components: Core
> Affects Versions: 0.4
> Environment: JBoss AS 7.2.0.Final (EAP 6.1.0.Alpha1)
> Reporter: Richard DiCroce
> Assignee: Mark Struberg
> Fix For: 0.5
>
>
> The method PropertyFileUtils.getResourceBundle(String bundleName, Locale
> locale) doesn't work correctly in an EAR.
> I have the DS core JARs in the EAR /lib and I'm trying to use the JsfMessage
> feature in one of my WARs. Because getResourceBundle() calls
> ResourceBundle.getBundle(String bundleName, Locale locale), Java attempts to
> load the resource bundle using the classloader that was used to load
> PropertyFileUtils, which is the EAR's classloader. The property files are in
> the WAR, so Java can't find them.
> Changing
> return ResourceBundle.getBundle(bundleName, locale);
> to
> return ResourceBundle.getBundle(bundleName, locale,
> Thread.currentThread().getContextClassLoader());
> fixes the problem.
--
This message was sent by Atlassian JIRA
(v6.1#6144)