[jboss-jira] [JBoss JIRA] (AS7-6378) BootstrapBundlesIntegration assumes META-INF/MANIFEST.MF is only available from 1 module
Brian Stansberry (JIRA)
jira-events at lists.jboss.org
Thu Jan 24 16:46:48 EST 2013
[ https://issues.jboss.org/browse/AS7-6378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Stansberry updated AS7-6378:
----------------------------------
Comment: was deleted
(was: OT: it would be nice if these were repackaged to go in a package o.j.a.t.integration.domain.respawn. Add 'domain' to be more consistent with the resut of the module. Be sure to look at the pom though; a repackage will lead to the tests not running if we aren't careful.)
> BootstrapBundlesIntegration assumes META-INF/MANIFEST.MF is only available from 1 module
> ----------------------------------------------------------------------------------------
>
> Key: AS7-6378
> URL: https://issues.jboss.org/browse/AS7-6378
> Project: Application Server 7
> Issue Type: Bug
> Components: OSGi
> Reporter: Brian Stansberry
> Assignee: Thomas Diesler
> Fix For: 7.2.0.Alpha1
>
>
> BootstrapBundlesIntegration has this:
> {code}
> URL manifestURL = module.getClassLoader().getResource(JarFile.MANIFEST_NAME); // PROBLEM
> if (manifestURL != null) {
> InputStream input = manifestURL.openStream();
> try {
> Manifest manifest = new Manifest(input);
> if (OSGiManifestBuilder.isValidBundleManifest(manifest)) {
> return OSGiMetaDataBuilder.load(manifest);
> }
> } finally {
> input.close();
> }
> }
> {code}
> The line marked // PROBLEM is problematic, since a module may have more than one resource associated with the given path, and that call will return the URL for the first one found, and not necessarily a URL for a resource located inside the intended module. For example, in testing a patch for a different issue I found that the same call for module "org.jboss.netty" could return a URL pointing to:
> org/jboss/logging/main/jboss-logging-3.1.2.GA.jar
> javax/servlet/api/main/jboss-servlet-api_3.0_spec-1.0.2.Final.jar
> org/jboss/netty/main/netty-3.4.5.Final.jar
> The first two modules are listed as dependencies of org.jboss.netty.
> A module could also include more than one jar, again leading to the possibility of multiple URLs with only one being relevant. But I'm not sure what the intended behavior is in that case.
> Calling getResources(JarFile.MANIFEST_NAME) instead of getResource and then iterating through the enumeration and checking to see if the URL is associated with the target module would be a possible fix.
--
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