[seam-issues] [JBoss JIRA] (SOLDER-222) EAR contained WAR's beans.xml not processed

Roberto Carta (JIRA) jira-events at lists.jboss.org
Fri May 25 18:43:17 EDT 2012


    [ https://issues.jboss.org/browse/SOLDER-222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12696185#comment-12696185 ] 

Roberto Carta commented on SOLDER-222:
--------------------------------------

I've seen this issue persists in version 3.1.0.Final + JBoss AS7.1.1.Final
In particular if solder-impl is placed in WEB-INF/lib directory, 
/META-INF/services/org.jboss.solder.servlet.resource.WebResourceLocationProvider file is not located by the classloader.


org.jboss.solder.util.service.ServiceLoader.loadServiceFiles() receive an empty Enumeration calling {{loader.getResources(serviceFile)}}
where
_loader_ is (org.jboss.modules.ModuleClassLoader): ModuleClassLoader for Module "deployment.earname.ear:main" from Service Module Loader
_serviceFile_ is: META-INF/services/org.jboss.solder.servlet.resource.WebResourceLocationProvider

But if you deploy the war module outside an EAR _WebResourceLocationProvider_ is founded.

A possibile solution is to call {{ServiceLoader.load(WebResourceLocationProvider.class, *null*)}} in order to avoid using context class loader.
This will result in using the:
ModuleClassLoader for Module "deployment.earname.ear.warname.war:main" from Service Module Loader


                
> EAR contained WAR's beans.xml not processed
> -------------------------------------------
>
>                 Key: SOLDER-222
>                 URL: https://issues.jboss.org/browse/SOLDER-222
>             Project: Solder
>          Issue Type: Bug
>    Affects Versions: 3.0.0.Final
>         Environment: JBoss AS 7
>            Reporter: Mike Mosiewicz
>            Assignee: Stuart Douglas
>
> I have the EAR app containing one ejb jar and one war. I placed seam-config.jar in EAR's lib directory. My beans.xml are discovered by weld as follows:
> 15:21:36,588 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/mongodb-seam-0.0.1-SNAPSHOT.jar/META-INF/beans.xml"
> 15:21:36,591 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-persistence-api-3.0.0.Final.jar/META-INF/beans.xml"
> 15:21:36,592 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-security-api-3.0.0.Final.jar/META-INF/beans.xml"
> 15:21:36,594 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-servlet-3.0.0.Final.jar/META-INF/beans.xml"
> 15:21:36,597 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-solder-3.0.0.Final.jar/META-INF/beans.xml"
> 15:21:36,601 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/commerce-ejb-0.0.1-SNAPSHOT.jar/META-INF/beans.xml"
> 15:21:36,603 DEBUG [org.jboss.weld] (MSC service thread 1-11) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/public-war.war/WEB-INF/beans.xml"
>  It seems that for ejb and other library jars the extension is executed but not for war. Like this:
> 15:21:54,173 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-security-api-3.0.0.Final.jar/META-INF/beans.xml
> 15:21:54,177 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/commerce-ejb-0.0.1-SNAPSHOT.jar/META-INF/beans.xml
> 15:21:54,195 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-servlet-3.0.0.Final.jar/META-INF/beans.xml
> 15:21:54,196 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/mongodb-seam-0.0.1-SNAPSHOT.jar/META-INF/beans.xml
> 15:21:54,197 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-solder-3.0.0.Final.jar/META-INF/beans.xml
> 15:21:54,204 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Adding XML Defined Bean: pl.proinet.seam.mongo.MongoResolver

--
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