[seam-issues] [JBoss JIRA] (SOLDER-220) Solder-config configuration does not work for WEB-INF/beans.xml files (but it weld does work on them)

Shane Bryzak (Assigned) (JIRA) jira-events at lists.jboss.org
Mon Dec 12 07:55:10 EST 2011

     [ https://issues.jboss.org/browse/SOLDER-220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shane Bryzak reassigned SOLDER-220:

    Assignee: Stuart Douglas

Stuart could you please comment on this?
> Solder-config configuration does not work for WEB-INF/beans.xml files (but it weld does work on them)
> -----------------------------------------------------------------------------------------------------
>                 Key: SOLDER-220
>                 URL: https://issues.jboss.org/browse/SOLDER-220
>             Project: Solder
>          Issue Type: Bug
>    Affects Versions: 3.0.0.Final
>         Environment: JBoss 7, Tomcat 6, linux, IntelliJ
>            Reporter: Geoffrey De Smet
>            Assignee: Stuart Douglas
>            Priority: Critical
>             Fix For: 3.1.0.Final
> The CDI spec says that in a WAR file, WEB-INF/beans.xml should be used for CDI configuration.
> Weld's configuration such as <weld:scan> works fine in that WEB-INF/beans.xml file.
> Solder's configuration does not work on JBoss AS 7, Tomcat 6 and Jetty 6: any configuration in that in that WEB-INF/beans.xml file is ignored.
> To reproduce:
> Create a war with a bean MyBean.
> Use solder-config on WEB-INF/beans.xml to set an parameter on MyBean
> that MyBean uses in a @PostConstruct method (or crashes if it's not set).
> Old Description:
> ================
> Does not work in jboss 7, tomcat 6 and gwt hosted mode (~ jetty 6).
> Occurs for both exploded war and not exploded war.
> Strangely enough, it doesn't ignore it for the root xml schema validation.
> The problem is probably in ClasspathResourceLoader.getResources(String name):
>  when name = "WEB-INF/beans.xml", it returns an empty Set, while it should contain something like:
> /.../guvnor/guvnor-webapp/target/guvnor-webapp-5.3.0-SNAPSHOT/WEB-INF/beans.xml
> Thread.currentThread().getContextClassLoader() returns an instance of org.apache.catalina.loader.WebappClassLoader
> When asking
>   Thread.currentThread().getContextClassLoader().getResourceAsStream("WEB-INF/beans.xml")
>   or Thread.currentThread().getContextClassLoader().getResourceAsStream("/WEB-INF/beans.xml")
> it returns null (so the catalina WebappClassLoader returns null for that).
> even this returns null:
>   or Thread.currentThread().getContextClassLoader().getResourceAsStream("WEB-INF/web.xml")
> yet asking a resource, such as
>   Thread.currentThread().getContextClassLoader().getResourceAsStream("/drools-asseteditors.xml")
> does not return null, but the correct resource.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list