Buggy code:
class BootstrapBundlesIntegration extends BootstrapBundlesInstall < Void > { private final InjectedValue < BundleManager > injectedBundleManager = new InjectedValue < BundleManager > ( ) ; private final InjectedValue < BundleStorage > injectedStorageProvider = new InjectedValue < BundleStorage > ( ) ; private final InjectedValue < ServerEnvironment > injectedServerEnvironment = new InjectedValue < ServerEnvironment > ( ) ; private final InjectedValue < BundleContext > injectedSystemContext = new InjectedValue < BundleContext > ( ) ; private final InjectedValue < PackageAdmin > injectedPackageAdmin = new InjectedValue < PackageAdmin > ( ) ; private final InjectedValue < StartLevel > injectedStartLevel = new InjectedValue < StartLevel > ( ) ; private final InjectedValue < SubsystemState > injectedSubsystemState = new InjectedValue < SubsystemState > ( ) ; private final InjectedValue < XEnvironment > injectedEnvironment = new InjectedValue < XEnvironment > ( ) ; private final InjectedValue < XRepository > injectedRepository = new InjectedValue < XRepository > ( ) ; private List < OSGiCapability > modulecaps ; private File bundlesDir ; BootstrapBundlesIntegration ( ) { } @ Override protected void addServiceDependencies ( ServiceBuilder < Void > builder ) { } @ Override public synchronized void start ( StartContext context ) throws StartException { } @ Override protected ServiceController < Void > installResolveService ( ServiceTarget serviceTarget , Set < ServiceName > installedServices ) { } private boolean installInitialModuleCapability ( OSGiCapability configcap ) throws Exception { } private Deployment getInitialBundleDeployment ( OSGiCapability configcap ) throws Exception { } private boolean isValidModuleIdentifier ( String identifier ) { } private boolean isValidMavenIdentifier ( String identifier ) { } private Deployment getDeploymentFromURL ( URL bundleURL , String location , Integer level ) throws Exception { } private OSGiMetaData getModuleMetadata ( Module module ) throws IOException { <START_BUG> URL manifestURL = module . getClassLoader ( ) . getResource ( JarFile . MANIFEST_NAME ) ; <END_BUG> if ( manifestURL != null ) { InputStream input = manifestURL . openStream ( ) ; try { Manifest manifest = new Manifest ( input ) ; if ( OSGiManifestBuilder . isValidBundleManifest ( manifest ) ) { return OSGiMetaDataBuilder . load ( manifest ) ; } } finally { input . close ( ) ; } } File homeDir = injectedServerEnvironment . getValue ( ) . getHomeDir ( ) ; final File modulesDir = new File ( ( ( homeDir + ( File . separator ) ) + "modules" ) ) ; final ModuleIdentifier identifier = module . getIdentifier ( ) ; String identifierPath = ( ( identifier . getName ( ) . replace ( '.' , File . separatorChar ) ) + ( File . separator ) ) + ( identifier . getSlot ( ) ) ; File entryFile = new File ( ( ( ( ( modulesDir + ( File . separator ) ) + identifierPath ) + ( File . separator ) ) + "jbosgi-xservice.properties" ) ) ; if ( entryFile . exists ( ) ) { FileInputStream input = new FileInputStream ( entryFile ) ; try { Properties props = new Properties ( ) ; props . load ( input ) ; return OSGiMetaDataBuilder . load ( props ) ; } finally { input . close ( ) ; } } return null ; } class BootstrapResolveIntegration extends BootstrapBundlesResolve < Void > { BootstrapResolveIntegration ( ServiceName baseName , Set < ServiceName > installedServices ) { } @ Override protected ServiceController < Void > installActivateService ( ServiceTarget serviceTarget , Set < ServiceName > resolvedServices ) { } } class BootstrapActivateIntegration extends BootstrapBundlesActivate < Void > { BootstrapActivateIntegration ( ServiceName baseName , Set < ServiceName > installedServices ) { } @ Override public void start ( StartContext context ) throws StartException { } } }

Fix:
URL manifestURL = module . getExportedResource ( JarFile . MANIFEST_NAME ) ;