[shrinkwrap-issues] [JBoss JIRA] (SHRINKWRAP-369) ShrinkWrapClassLoader does not find service provider in WAR
Davide D'Alto (Commented) (JIRA)
jira-events at lists.jboss.org
Mon Dec 19 08:17:09 EST 2011
[ https://issues.jboss.org/browse/SHRINKWRAP-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651938#comment-12651938 ]
Davide D'Alto commented on SHRINKWRAP-369:
------------------------------------------
I think in this case what you should read is the specification of the Content Dependency Injection (JSR-299: http://jcp.org/aboutJava/communityprocess/final/jsr299/index.html).
{quote}
12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the META-INF directory.
• The WEB-INF/classes directory of a war is a bean archive if there is a file named beans.xml in the WEB-INF directory of the war.
• A directory in the JVM classpath is a bean archive if it has a file named beans.xml in the META-INF directory.
{quote}
I suppose that different JSR can potentially decide for different location of the META-INF.
By the way, I could be wrong but the arquillilan weld container doesn't seem to check the existence of a beans.xml in a JAR ... I'm not sure if this is a good thing.
> ShrinkWrapClassLoader does not find service provider in WAR
> -----------------------------------------------------------
>
> Key: SHRINKWRAP-369
> URL: https://issues.jboss.org/browse/SHRINKWRAP-369
> Project: ShrinkWrap
> Issue Type: Bug
> Components: api
> Affects Versions: 1.0.0-beta-3
> Reporter: Martin Kouba
>
> I ran into this issue when working with *Arquillian* and *Weld EE 1.1 Embedded container* (that uses ShrinkWrapClassLoader under the hood). ShrinkWrap correctly builds web archive with CDI extension (using org.jboss.shrinkwrap.api.container.ManifestContainer.addAsServiceProvider(Class<?>, Class<?>...); this was also discussed in SHRINKWRAP-266).
> Output:
> {code}
> test.war
> /WEB-INF/
> /WEB-INF/classes/
> /WEB-INF/classes/META-INF/
> /WEB-INF/classes/META-INF/services/
> /WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension
> {code}
> However no extensions are found. *org.jboss.shrinkwrap.api.classloader.ShrinkWrapClassLoader* probably does not find any resource when looking for "META-INF/services/javax.enterprise.inject.spi.Extension".
> Note that I'm not quite sure whether it's ShrinkWrapClassLoader or WeldEEMockContainer issue.
--
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 shrinkwrap-issues
mailing list