title: Pax Exam issue with Apache POI wrapped bundle
body: <p>I have been beating my head against the wall trying to get Apache POI to work within an OSGi bundle.  Here is the history of what I have tried with no luck:</p>
  
  <p>1) I initially tried using the pre wrapped Apache Servicemix POI bundle.  However this had many dependencies I had to deploy, many of which were not needed.  I hit a wall as even after adding Apache POI servicemix (and its dependencies), i was still getting issues with missing classes.</p>
  
  <p>2) Due to the amount of unneeded stuff in the first solution, I decided to wrap up the dependencies inside a bundle.  Basically I have a Blueprint service that acts as a wrapper for the POI functionality.  All unit tests work fine but my pax exam tests were failing.</p>
  
  <p>At first, it couldn't find classes that were dependencies (commons-codec,xmlbeans, etc).  So I added the POI and POI OOMXL dependencies and all the other dependencies it needed.  This solved most of the class loader issues.  However this is the one I am currently stuck on.  The bundle starts just fine, but once it hits a point where it tries create an excel workbook, it fails with the following stack trace:</p>
  
  <pre><code>java.lang.ClassNotFoundException: com.bea.xml.stream.EventFactory not found by org.ops4j.pax.exam.rbc [104]
  
  at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
  at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
  at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:68)
  at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:178)
  at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
  at javax.xml.stream.XMLEventFactory.newInstance(XMLEventFactory.java:30)
  </code></pre>
  
  <p>Here are the dependencies I am including:</p>
  
  <pre><code>        &lt;dependency&gt;
              &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
              &lt;artifactId&gt;poi&lt;/artifactId&gt;
              &lt;version&gt;${apache.poi.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
              &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;
              &lt;version&gt;${apache.poi.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-codec&lt;/groupId&gt;
              &lt;artifactId&gt;commons-codec&lt;/artifactId&gt;
              &lt;version&gt;1.9&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.17&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.xmlbeans&lt;/groupId&gt;
              &lt;artifactId&gt;xmlbeans&lt;/artifactId&gt;
              &lt;version&gt;2.6.0&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>It seems that the pax container cannot find the EventFactory.  If anyone has any suggestions i would greatly appreciate the help.</p>