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

BootstrapBundlesIntegration assumes META-INF/MANIFEST.MF is only available from 1 module


      BootstrapBundlesIntegration has this:

      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 {

      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:


      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.

            tdiesler@redhat.com Thomas Diesler
            bstansbe@redhat.com Brian Stansberry
            0 Vote for this issue
            2 Start watching this issue