My goal is to create an Excel 2007 document (XLSX) in an Eclipse RCP Environment (Excel 2003 is simple). I don't want to place the POI jars inside a /lib folder, instead I want to use a working POI OSGI bundle from my target definition.
All my attempts so far have failed to create a working OSGI bundle of POI 3.8. What I did so far:
I merged all relevant JAR files with the Ant zip task:
- poi-3.8-beta3-20110606.jar
- poi-ooxml-3.8-beta3-20110606.jar
- poi-ooxml-schemas-3.8-beta3-20110606.jar
- poi-scratchpad-3.8-beta3-20110606.jar
I ran the bnd tool with the wrap parameter:
java -jar biz.aQute.bnd.jar wrap ./poi-3.8-beta3-20110606-merged.jar
I had to bundle the jars in the /ooxml-lib folder separately, with bnd:
- xmlbeans-2.3.0.jar
- stax-api-1.0.1.jar
- dom4j-1.6.1.jar
This leads to ClassNotFoundExceptions for
org.w3c.dom.Node
because xmlbeans-2.3.0.jar exports four classes from this packageorg.w3c.dom
. Normally the JavaSE-RuntimeEnvironment would export these.I deleted the
org/w3c/dom
folder from xmlbeans-2.3.0.jar and rebundled the jar but I got other ClassNotFoundExceptions.
This is where I got so far. I think working with bnd wrap is not enough. Probably I must create a bnd.properties file and have explicit Export-Package/Import-Package statements but which work?
So, has anyone successfully managed to create a working POI 3.8 OSGI bundle?