title: hbase and osgi - can't find hbase-default.xml
body: <p>as hbase is not available as osgi-ified bundle yet I managed to create the bundle with the maven felix plugin (hbase 0.92 and the corresponding hadoop-core 1.0.0), and both bundles are starting up in OSGi :)</p>
  
  <p>also the hbase-default.xml is added to the resulting bundle. in the resulting osgi-jar, when I open it, the structure looks like this:</p>
  
  <ul>
  <li>org/</li>
  <li>META-INF</li>
  <li>hbase-default.xml</li>
  </ul>
  
  <p>This was achieved with <code>&lt;Include-Resource&gt;@${pkgArtifactId}-${pkgVersion}.jar!/hbase-default.xml&lt;/Include-Resource&gt;</code></p>
  
  <p>The problem comes up when I actually want to connect to hbase. hbase-default.xml can not be found and thus I can not create any configuration file. </p>
  
  <p>The hbase osgi bundle is used from within another osgi-bundle that should be used to get an hbase connection and query the database. This osgi-bundle is used by an RCP application.</p>
  
  <p>My question is, where do I have to put my hbase-default.xml so that it will be found when the bundle is started? or why does it not realize that the file is existing?</p>
  
  <p>Thank you for any hints.</p>
  
  <p>-- edit</p>
  
  <p>I found a decompiler so I could view the source where the loading of the configuration is executed (hadoop-core which does not provide any sources via maven) and I now see that the Threads contextClassLoader is used (and if not available the classLoader of the Configuration class itself), so it seems to me that it can't find the resource, but, it should, according to the description, also check the parents (but who is the parent in an OSGi environment?)?</p>
  
  <p>I tested to get the resource from the OSGi-bundle that should use hbase, where I added hbase-default.xml to the created jar file (see above), and there I get a resource when I get the contextClassLoader of the thread. When I explored the code a bit more I realized that there is no way to set the classloader for the HBaseConfiguration (although it would be possible to set the classloader for a "simple" hadoop-Configuration, HBaseConfiguration inherits from, but the creation procedure of HBaseConfiguration does not allow it, as it simply creates a new object within the create() method.</p>
  
  <p>I really hope you have some idea how to get this up and running :)</p>