opensagres / xdocreport

XDocReport means XML Document reporting. It's Java API to merge XML document created with MS Office (docx) or OpenOffice (odt), LibreOffice (odt) with a Java model to generate report and convert it if you need to another format (PDF, XHTML...).
https://github.com/opensagres/xdocreport
1.22k stars 372 forks source link

PDF Converter + Apache POI 3.12: NoClassDefFoundError: org/apache/poi/wp/usermodel/Paragraph #39

Open benneq opened 9 years ago

benneq commented 9 years ago

When trying to convert some docx to pdf, it throws NoClassDefFoundError: org/apache/poi/wp/usermodel/Paragraph. This happens, when Apache POI 3.12 is on the ClassPath. When using POI 3.11 it works as expected.

This is the code we use:

OutputStream out = ...;
XWPFDocument doc = new XWPFDocument(docxFile.getInputStream());
PdfOptions options = PdfOptions.create().fontEncoding("windows-1250");
PdfConverter.getInstance().convert(doc, out, options);

pom.xml:

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.12</version>
</dependency>
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.12</version>
</dependency>
<dependency>
    <groupId>fr.opensagres.xdocreport</groupId>
    <artifactId>org.apache.poi.xwpf.converter.pdf</artifactId>
    <version>1.0.5</version>
</dependency>
angelozerr commented 9 years ago

It seems that it's the same problem than https://bz.apache.org/bugzilla/show_bug.cgi?id=57957