title: NullPointerException when accessing OSGi bundle resources
body: <p>I am using two OSGi frameworks within a plain Java application. Both frameworks load bundles from a shared directory.</p>
  
  <p>In one bundle, I load a file from the resources. I tried different ways e.g. </p>
  
  <pre><code>this.getClass().getClassLoader().getResourceAsStream(...)
  FrameworkUtil.getBundle(XXX.class).getEntry(...)
  FrameworkUtil.getBundle(XXX.class).getResource(...)
  </code></pre>
  
  <p>But it doesn't matter which of the commands I use, it all works fine at the beginning. However, after several install and uninstall steps in both frameworks. The returned InputStream is null.</p>
  
  <p>I also works fine if use just one OSGi framework.</p>
  
  <p>After debugging a little, I found that the Bundle a got with</p>
  
  <pre><code>FrameworkUtil.getBundle(XXX.class)
  </code></pre>
  
  <p>is pointing to the correct jar-file BUT when I look for the referenced bundlefile in the BundleData of the Bundle, it references the bundlefile of another bundle. The bundlefiles are temporary files of the OSGi framework (Equinox in my case), that can be found for example in the local Maven repository:</p>
  
  <p>.m2\repository\org\eclipse\osgi\org.eclipse.osgi\3.6.0.v20100517\configuration\org.eclipse.osgi\bundles\29\1</p>
  
  <p>Anyone has an idea what could be wrong here?</p>