[jboss-jira] [JBoss JIRA] (AS7-5864) Classes of a module cannot get access to the META-INF folder in its own jar/module

David Lloyd (JIRA) jira-events at lists.jboss.org
Thu Nov 1 11:41:18 EDT 2012


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

David Lloyd commented on AS7-5864:
----------------------------------

If you want to access resources of your own module, simply do this:

{code}
getClass().getClassLoader().getResources("META-INF/blah.txt");
{code}

Or better yet,

{code}
getClass().getResource("/META-INF/blah.txt");
{code}

The TCCL points to the deployment, but constituent JARs may have their META-INF filtered from the perspective of the WAR.  Whether that is a bug would have to be verified in the spec; I suspect it is (we probably want to be sure that the default filter for constituent JAR import into primary EE modules are all-inclusive).

The most likely reason that the {{jboss-deployment-structure.xml}} fix didn't work is that the filters apply to directories, not files; in other words you've included all files in all child directories of {{META-INF}} without including the files in {{META-INF}} itself.
                
> Classes of a module cannot get access to the META-INF folder in its own jar/module
> ----------------------------------------------------------------------------------
>
>                 Key: AS7-5864
>                 URL: https://issues.jboss.org/browse/AS7-5864
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: Class Loading
>    Affects Versions: 7.1.1.Final
>            Reporter: John Wu
>            Assignee: David Lloyd
>         Attachments: jboss-access-meta-inf.zip
>
>
> 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|https://issues.jboss.org/browse/AS7-1928].

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list