You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Gerhard Petracek (JIRA)" <ji...@apache.org> on 2014/04/22 22:26:18 UTC

[jira] [Resolved] (DELTASPIKE-451) Using @ConfigProperty in an EAR File on JBoss 7 fails

     [ https://issues.apache.org/jira/browse/DELTASPIKE-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gerhard Petracek resolved DELTASPIKE-451.
-----------------------------------------

    Resolution: Not a Problem

>  Using @ConfigProperty in an EAR File on JBoss 7 fails
> ------------------------------------------------------
>
>                 Key: DELTASPIKE-451
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-451
>             Project: DeltaSpike
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 0.5
>         Environment: JBoss 6.1.1 EAP (JBoss AS 7.2.1) on Windows XP
>            Reporter: Thomas Stemmer
>            Assignee: Mark Struberg
>
> I'm using @ConfigProperty for loading properties from a propertyfile. This works fine as long as I deploy the application as an WAR File. If I wrap the WAR in an EAR File the Properties won't get loaded. This is caused by the different classloaders for startup (EAR) and property access (WAR).
> In Detail:
> - The properties are loaded on EAR Startup with the EAR classloader
> - The properties are put in the org.apache.deltaspike.core.api.config.ConfigResolver.configSources HashMap, the key is the EAR Classloader
> - The properties are accessed in the WAR File, so the WAR classloader is used
> - The ...ConfigResolver.getConfigSources() uses the WAR classloader as a key for the HashMap
> - No properties are found because of the wrong key (WAR instead of EAR classloader)
> Possible Solution by Mark Struberg from the mailinglist:
> "We should walk up the parent ClassLoader chain like we do in BeanManagerProvider."
> http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201311.mbox/%3C1385476770.76979.YahooMailNeo%40web28902.mail.ir2.yahoo.com%3E



--
This message was sent by Atlassian JIRA
(v6.2#6252)