[jboss-jira] [JBoss JIRA] (AS7-1928) Allow deployments to get access to the META-INF folder of their dependency module

John Wu (JIRA) jira-events at lists.jboss.org
Thu Jul 19 15:05:07 EDT 2012


    [ https://issues.jboss.org/browse/AS7-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706937#comment-12706937 ] 

John Wu edited comment on AS7-1928 at 7/19/12 3:04 PM:
-------------------------------------------------------

Resources in META-INF/ in a module resource (JAR file or expanded directory) are *still* not accessible *from within that module*.

Quote from the Issue Description:
{quote}
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. Essentially, there is no way of accessing resources under META-INF unless they are either services, or the library is packaged in the deployment.
{quote}
Here is the scenario:
# I have a framework jar (access-meta-inf-framework-1.0.0.jar) which has the following content:
{code}
/org/...                       // listener, servlet, and util classes
/META-INF
|   +Resource.txt
+NormalClasspathResource.txt
{code}
# The framework jar is defined as a module as follows:
{code:xml}
<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>
{code}
*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/
{code:xml}
<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>
{code}
# The result is:
{code}
... ... ... === 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
{code}
# You may verify that with the attached project (jboss-access-meta-inf.zip), which is stemmed from a real issue discussed here (http://stackoverflow.com/questions/8098684/spring-module-in-jboss-7).
# The environment: JBoss AS 7.1.1.Final, Oracle JDK 1.6.0_31, Windows XP SP3.

                
      was (Author: phantom_john):
    Resources in META-INF/ in a module resource (JAR file or expanded directory) are *still* not accessible *from within that module*.

Quote from the Issue Description:
{quote}
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. Essentially, there is no way of accessing resources under META-INF unless they are either services, or the library is packaged in the deployment.
{quote}
Here is the scenario:
# I have a framework jar (access-meta-inf-framework-1.0.0.jar) which has the following content:
{code}
/org/...                       // listener, servlet, and util classes
/META-INF
|   +Resource.txt
+NormalClasspathResource.txt
{code}
# The framework jar is defined as a module as follows:
{code:xml}
<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>
{code}
*The file access-meta-inf-framework-1.0.0.jar is located in $JBOSS_HOME/modules/org/wjh/jboss/module/framework/main/*
# The result is:
{code}
... ... ... === 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
{code}
# You may verify that with the attached project (jboss-access-meta-inf.zip), which is stemmed from a real issue discussed here (http://stackoverflow.com/questions/8098684/spring-module-in-jboss-7).
# The environment: JBoss AS 7.1.1.Final, Oracle JDK 1.6.0_31, Windows XP SP3

                  
> Allow deployments to get access to the META-INF folder of their dependency module
> ---------------------------------------------------------------------------------
>
>                 Key: AS7-1928
>                 URL: https://issues.jboss.org/browse/AS7-1928
>             Project: Application Server 7
>          Issue Type: Feature Request
>    Affects Versions: 7.1.0.Alpha1
>            Reporter: Marius Bogoevici
>            Assignee: Stuart Douglas
>             Fix For: 7.1.0.Final
>
>         Attachments: jboss-access-meta-inf.zip, modular-app.META-INF.not.accessible.zip
>
>
> Currently there is absolutely no mechanism (outside of manipulating dependencies programmatically through a subsystem) for deployments to get access to some META-INF/xyz files from a module that they declare as a dependency, 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. 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 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