Currently the Orbit project makes available Apache POI 3.9 and I've been using that for a while without problems.
The currently stable version of POI is 3.13 and there have been significant improvements to the library in the last 3+ years. I'd like to use 3.13, but I haven't been able to make it work.
I have been trying to repackage the 3.13 jars using maven. Here is my current maven file (I had to remove namespaces because I have less than 5 messages in this forum...trust me they are there in the actual file )
<?xml version="1.0"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>repackaged.apache-poi-osgi</artifactId>
<version>3.13.0</version>
<packaging>bundle</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>*</Embed-Dependency>
<_exportcontents>
org.apache.poi.*;version="3.13.0"
</_exportcontents>
<Bundle-ClassPath>{maven-dependencies}</Bundle-ClassPath>
<!--Embed-Transitive>true</Embed-Transitive-->
<Import-Package>!*</Import-Package>
<_failok>true</_failok>
<_nouses>true</_nouses>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.13</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.13</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.13</version>
</dependency>
</dependencies>
</project>
Most everything else I was able to get from Orbit and other p2 repositories. But when I attempt to use POI within my test class I get the following stack trace:
javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found
at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
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)
at org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.<clinit>(PackagePropertiesMarshaller.java:41)
at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:162)
at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:142)
at org.apache.poi.openxml4j.opc.Package.<init>(Package.java:37)
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:130)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:252)
at com.example.WordDocumentLoader.load(WordDocumentLoader.java:27)
at com.example.WordDocumentLoaderTest.test_word_document_loader(WordDocumentLoaderTest.java:24)
Anybody have an idea how to get java.xml.stream working in eclipse RCP? Or does anyone have experience getting Apache POI to work in eclipse RCP?