Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-5864

Classes of a module cannot get access to the META-INF folder in its own jar/module

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 7.1.1.Final
    • Class Loading
    • None
    • Hide
      1. The framework jar (access-meta-inf-framework-1.0.0.jar) has the following content:
        /org/...                       // listener, servlet, and util classes
        /META-INF
        |   +Resource.txt
        +NormalClasspathResource.txt
        
      2. The framework jar is defined as a module as follows:
        <module xmlns="urn:jboss:module:1.1" name="org.wjh.jboss.module.framework">
            <resources>
                <resource-root path="access-meta-inf-framework-1.0.0.jar">
                    <filter>
                        <include path="META-INF/**" />
                    </filter>
                </resource-root>
            </resources>
        
            <dependencies>
                <module name="javax.servlet.api" export="true" />
        
                <module name="javax.api" export="true" />
            </dependencies>
        </module>
        

        The file access-meta-inf-framework-1.0.0.jar is located in $JBOSS_HOME/modules/org/wjh/jboss/module/framework/main/

      3. The jboss-deployment-structure.xml in the Access_META-INF.ear/META-INF/
        <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
        
            <ear-subdeployments-isolated>true</ear-subdeployments-isolated>
        
            <deployment>
                <dependencies>
                    <module name="org.wjh.jboss.module.framework" export="true" meta-inf="export" />
                </dependencies>
            </deployment>
        
        </jboss-deployment-structure>
        
      4. Once Access_META-INF.ear is deployed, the result shows as follows:
        ... ... ... === Initializing ServletContext.
        ... ... ... The following resource(s) are found at location NormalClasspathResource.txt
        ... ... ... --- jar:file:$JBOSS_MODULEPATH/org/wjh/jboss/module/framework/main/access-meta-inf-framework-1.0.0.jar!/NormalClasspathResource.txt
        ... ... ... *** *** NO resource is found at location META-INF/Resource.txt
        ... ... ... === Initializing Servlet.
        ... ... ... The following resource(s) are found at location NormalClasspathResource.txt
        ... ... ... --- jar:file:$JBOSS_MODULEPATH/org/wjh/jboss/module/framework/main/access-meta-inf-framework-1.0.0.jar!/NormalClasspathResource.txt
        ... ... ... *** *** NO resource is found at location META-INF/Resource.txt
        ... ... ... === Servicing HttpServletRequest.
        ... ... ... The following resource(s) are found at location NormalClasspathResource.txt
        ... ... ... --- jar:file:$JBOSS_MODULEPATH/org/wjh/jboss/module/framework/main/access-meta-inf-framework-1.0.0.jar!/NormalClasspathResource.txt
        ... ... ... *** *** NO resource is found at location META-INF/Resource.txt
        
      5. You may verify that with the attached project (jboss-access-meta-inf.zip).
      Show
      The framework jar (access-meta-inf-framework-1.0.0.jar) has the following content: /org/... // listener, servlet, and util classes /META-INF | +Resource.txt +NormalClasspathResource.txt The framework jar is defined as a module as follows: <module xmlns= "urn:jboss:module:1.1" name= "org.wjh.jboss.module.framework" > <resources> <resource-root path= "access-meta-inf-framework-1.0.0.jar" > <filter> <include path= "META-INF/**" /> </filter> </resource-root> </resources> <dependencies> <module name= "javax.servlet.api" export= "true" /> <module name= "javax.api" export= "true" /> </dependencies> </module> The file access-meta-inf-framework-1.0.0.jar is located in $JBOSS_HOME/modules/org/wjh/jboss/module/framework/main/ The jboss-deployment-structure.xml in the Access_META-INF.ear/META-INF/ <jboss-deployment-structure xmlns= "urn:jboss:deployment-structure:1.1" > <ear-subdeployments-isolated> true </ear-subdeployments-isolated> <deployment> <dependencies> <module name= "org.wjh.jboss.module.framework" export= "true" meta-inf= "export" /> </dependencies> </deployment> </jboss-deployment-structure> Once Access_META-INF.ear is deployed, the result shows as follows: ... ... ... === Initializing ServletContext. ... ... ... The following resource(s) are found at location NormalClasspathResource.txt ... ... ... --- jar:file:$JBOSS_MODULEPATH/org/wjh/jboss/module/framework/main/access-meta-inf-framework-1.0.0.jar!/NormalClasspathResource.txt ... ... ... *** *** NO resource is found at location META-INF/Resource.txt ... ... ... === Initializing Servlet. ... ... ... The following resource(s) are found at location NormalClasspathResource.txt ... ... ... --- jar:file:$JBOSS_MODULEPATH/org/wjh/jboss/module/framework/main/access-meta-inf-framework-1.0.0.jar!/NormalClasspathResource.txt ... ... ... *** *** NO resource is found at location META-INF/Resource.txt ... ... ... === Servicing HttpServletRequest. ... ... ... The following resource(s) are found at location NormalClasspathResource.txt ... ... ... --- jar:file:$JBOSS_MODULEPATH/org/wjh/jboss/module/framework/main/access-meta-inf-framework-1.0.0.jar!/NormalClasspathResource.txt ... ... ... *** *** NO resource is found at location META-INF/Resource.txt You may verify that with the attached project (jboss-access-meta-inf.zip).

    Description

      Currently there is absolutely no mechanism for classes of a module to get access to some META-INF/xyz files in its own jar/module, except are in META-INF/services.
      This is a serious impediment when considering the installation of third party libraries as shared libraries (modules) in JBoss AS. Some frameworks may rely upon locating internal descriptors in META-INF, and if the libraries are installed as modules, the descriptors are not accessible to the framework itself. Essentially, there is no way of accessing resources under META-INF unless they are either services, or the library is packaged in the deployment.

      This is the un-resolved part of issue AS7-1928.

      Attachments

        Activity

          People

            dlloyd@redhat.com David Lloyd
            phantom_john John Wu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: