[jboss-jira] [JBoss JIRA] (AS7-3203) jboss-deployment-structure.xml: dependencies for all modules

erik van altena (Created) (JIRA) jira-events at lists.jboss.org
Thu Jan 5 10:54:09 EST 2012


jboss-deployment-structure.xml: dependencies for all modules
------------------------------------------------------------

                 Key: AS7-3203
                 URL: https://issues.jboss.org/browse/AS7-3203
             Project: Application Server 7
          Issue Type: Enhancement
          Components: Class Loading
    Affects Versions: 7.0.2.Final
            Reporter: erik van altena
            Assignee: David Lloyd
            Priority: Minor


I deploy an ear with an EJB and a WAR module. In both modules I want to use logging, so I want to add the org.slf4j module to their classpath.

My first attempt to get this done was this simple jboss-deployment-structure.xml file which I placed in the META-INF folder of the EAR.

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>  
  <deployment>  
    <dependencies>  
        <module name="org.slf4j" />  
    </dependencies>
  </deployment>  
</jboss-deployment-structure>

This however, does not get the job done in the case of an EAR though; SLF4J is not on the classpath of either ear module. When I deploy this exact file in a web application that deploys as a war (in the WEB-INF folder), this does work. Of course that makes some sense as the war doesn't have sub-deployments.


In stead, I have to do this:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>  
  <deployment>  
    <dependencies>  
        <module name="org.slf4j" />  
    </dependencies>
  </deployment>  
  <sub-deployment name="chipstkpov-ejb.jar">
    <dependencies>  
        <module name="org.slf4j" />  
    </dependencies>
  </sub-deployment>  
  <sub-deployment name="chipstkpov-web.war">
    <dependencies>  
        <module name="org.slf4j" />  
    </dependencies>
  </sub-deployment>  
</jboss-deployment-structure>

Note that the <deployment> section is still needed, if I leave it out the dependency still does not end up on the classpath of the sub-deployments. With this exact setup the EAR deploys just fine.


As I understand from my test results, you need to;

- define the dependencies you want to expose to the classpath in the <modules> section
- per sub-deployment you have to then explicitly add that dependency as well

What I would expect and prefer is that the first example I gave would do exactly the same WITHOUT me having to explicitly name the sub-deployments of the ear in this file. That is duplicate maintenance as any change I make to the build structure (maven poms in my case) I will now have to duplicate in this file.

Note that if I am correct in my findings, it would be very useful if this is documented in the jboss classloading documentation.

https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7

--
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 jboss-jira mailing list