I'm trying to use Apache POI Library in Eclipse RCP project.
So I added poi, poi-ooxml and poi-ooxml-schemas to project, but still got an Exception
java.lang.NoClassDefFoundError: org/apache/poi/util/POILogFactory at org.apache.poi.POIXMLDocumentPart.<clinit>(POIXMLDocumentPart.java:53)
at this line:
XWPFDocument doc = new XWPFDocument();
To add poi to project there is a p2-repository and p2-maven plugin with following artifacts:
<artifact>
<id>org.apache.poi:poi:3.14</id>
<source>true</source>
<transitive>false</transitive>
<instructions>
<Import-Package></Import-Package>
<Export-Package>*</Export-Package>
<DynamicImport-Package>*</DynamicImport-Package>
</instructions>
</artifact>
(and the same with <id>org.apache.poi:poi-ooxml:3.14</id>
and <id>org.apache.poi:poi-ooxml-schemas:3.14</id>
)
.
I tried to use POILoggerFactory directly in code POILogger logger = POILogFactory.getLogger(POIXMLDocumentPart.class); logger.log(POILogger.INFO, "Test");
and it works!
I have no idea, what's wrong.