4 Replies Latest reply on Oct 28, 2013 9:30 AM by michael-s

    Module based applications affect each other

    michael-s Newbie

      We have two applications (ear and war) that are deployed together. When they do not use any custom modules in JBoss 7 they work fine.

      Then we extracted common libraries (spring, aspectj, etc.) into modules and and used them as dependencies in jboss-deployment-structure.xml of both applications.

      If these module based applications are deployed separately they still work fine but when they are deployed in the same JBoss (7.1.3 or 7.2/EAP 6.1.0) they affect each other and produce errors. It seems that the module based applications are not isolated.

      Is this a bug or could it be a wrong module configuration? Is there any situation where it is intended in JBoss7 that the applications are not isolated?

        • 1. Re: Module based applications affect each other
          Wolf-Dieter Fink Master

          Could you provide a bit more information how you configure the dependencies and what the issue is (logfile code etc.)

          • 2. Re: Re: Module based applications affect each other
            michael-s Newbie

            The issue is that a ThreadLocal variable used with spring security does not contain the correct value any more and the war application exits.

            The dependencies for the ear are configured with this xml:

            <jboss-deployment-structure>
               <deployment>
                  <dependencies>
                    <module name="org.jboss.ws.saaj-impl" export="true"/>
                    <module name="com.sun.xml.messaging.saaj" export="true"/>
                    <module name="javax.xml.soap.api"  export="true"/>
                    <module name="org.apache.xerces" services="import"  export="true"/>      
                    <module name="org.jboss.ironjacamar.jdbcadapters"/>
                     <module name="com.myfw" slot="4.2.3" export="true" meta-inf="export"> 
                       <imports>
                          <include path="META-INF**"/>
                          <exclude path="com/myfw/security**"/>
                       </imports>
                    </module>
                     <module name="org.hibernate" slot="3.6.9"> 
                       <imports>
                          <include path="META-INF**"/>
                       </imports>
                    </module>
                    <module name="org.springframework.spring" slot="3.0.5-1" export="true" meta-inf="export">
                       <imports>
                          <include path="META-INF**"/>
                       </imports>
                    </module>
                    <module name="org.springframework.ws" slot="2.0.3" export="true" meta-inf="export">
                       <imports>
                          <include path="META-INF**"/>
                       </imports>
                    </module>     
                    <module  name="org.apache.commons.beanutils-core" slot="1.8.3" export="true"/>
                    <module  name="org.apache.commons.collections" slot="3.2.1"  export="true"/>
                    <module  name="org.apache.commons.logging" slot="1.1.1" export="true"/>
                    <module  name="org.apache.commons.pool" slot="1.5.6" export="true"/>
                    <module  name="org.aspectj" slot="1.6.10" export="true"/>
                </dependencies>
               </deployment>
               <sub-deployment name="security-sc-server-webservice.war">
                 <dependencies>
                    <module name="org.springframework.spring" slot="3.0.5-1" export="true" meta-inf="export">
                       <imports>
                          <include path="META-INF**"/>
                       </imports>
                    </module>
                    <module name="org.springframework.ws" slot="2.0.3" export="true" meta-inf="export">
                       <imports>
                          <include path="META-INF**"/>
                       </imports>
                    </module>     
                 </dependencies>
               </sub-deployment>
            </jboss-deployment-structure>
            

            The dependencies for the war application are similar but without the sub-deployment section.

            The modules also have dependencies to each other.

            • 3. Re: Module based applications affect each other
              michael-s Newbie

              The problem also occurs in the latest versions: wildfly-8.0.0.Beta1 and jboss-eap-6.2.0.Beta.

              • 4. Re: Module based applications affect each other
                michael-s Newbie

                When I add the war into the ear and move all jars from the war WEB-INF/lib into the ear/lib folder the error mentioned above does not occur (even if the ear deployment uses module dependencies for the other libraries). However this is only a workaround and not the desired solution.