Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Apache POI 3.13 and javax.xml.stream(Anyone had any luck using Apache POI 3.13 or javax.xml.stream in an Eclipse RCP Application?)
Apache POI 3.13 and javax.xml.stream [message #1725490] Thu, 03 March 2016 20:31
Nate Jones is currently offline Nate JonesFriend
Messages: 5
Registered: December 2014
Junior Member
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 Smile )
<?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?
Previous Topic:Commercial support for RCP 4
Next Topic:Error with "platform:/plugin" scheme URI usage
Goto Forum:
  


Current Time: Tue Nov 24 03:02:26 GMT 2020

Powered by FUDForum. Page generated in 0.02084 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top