0 Replies Latest reply on Mar 11, 2013 5:20 AM by Natasha Biryukov

    Visibility of META-INF in global module, looks like filter tag is ignored

    Natasha Biryukov Newbie

      Hi all.

      We're in a middle of migration to JBoss7.1.1 Final version from JBoss4.

      We created a global module that contains our jars that were defined in class path of JBoss4.

      The problem is that some jars in the global module contain hibernate persistence.xml inside the META-INF folder:

       

      /META-INF

      |   +persistence.xml

       

      When myApp.war is trying to load hibernate configuration, hibernate fails to load the persistence.xml from the jars defined in the global module.

      Hibernate tries to do it with the following code.

      Thread.currentThread().getContextClassLoader().getResources( "META-INF/persistence.xml" );

       

      I tried to resolve it by defining a filter on the resource that contains the persistence.xml, but it didn't work:

      <resource-root path="my.jar" >    

           <filter>

                 <include path="META-INF/**" />

            </filter>   

      </resource-root>

       

      I can resolve it my explicit dependency on my global module and importing the META-INF (just as we do it in Spring):

       

      <jboss-deployment-structure>    

                <deployment>

                <dependencies>

                  <module name="my.global.module">

                      <imports>

                          <include path="META-INF**"/>

                      </imports>

                  </module>

              </dependencies>

          </deployment>

      </jboss-deployment-structure> 

       

      But it doesn't sound right, since it's a global module and should be visible for all, including it's META-INF.

       

      Any ideas why the filter tag doesn't work and how I can make the META-INF folder of jars in global module visible for all?

       

      Thanks in advance,

      Natasha