poi-ooxml-schemas and ooxml-schemas are not meant to be used together -- you 
use one or the other

poi-ooxml-lite is a new jar for newer versions of POI -- not to be used with 
pre-historic versions of POI like 3.14

fr.opensagres -- this is nothing whatsover to do with Apache POI - talk to 
OpenSagres about this jar





On Saturday 22 January 2022, 14:04:02 GMT+1, Валерий Зайченко 
<zayacv...@gmail.com> wrote: 





Good day
I used fr.opensagres.xdocreport:org.apache.poi.xwpf.converter.pdf:1.0.5 for
convert *.docx files to *.pdf. This converter depends on
org.apache.poi:poi-ooxml:3.14 and org.apache.poi:ooxml-schemas-1.1. In turn
org.apache.poi:poi-ooxml:3.14 depends on
org.apache.poi:poi:3.14 and org.apache.poi:poi-ooxml-schemas:3.14. But
org.apache.poi:ooxml-schemas-1.1 and org.apache.poi:poi-ooxml-schemas:3.14
have the same packages with same duplicate classes. For example
/org/openxmlformats/schemas/wordprocessingml/x2006/main. It isn't good for
building classpaths but this combination worked.
Now fr.opensagres.xdocreport:org.apache.poi.xwpf.converter.pdf moved to
fr.opensagres.xdocreport:fr.opensagres.poi.xwpf.converter.pdf.
fr.opensagres.xdocreport:fr.opensagres.poi.xwpf.converter.pdf:2.0.2 depend
from org.apache.poi:poi-ooxml:5.2.0 and org.apache.poi:ooxml-schemas:1.4.
In turn org.apache.poi:poi-ooxml:5.2.0 depend from
org.apache.poi:poi-ooxml-lite:5.2.0. As in early case
org.apache.poi:ooxml-schemas:1.4 and org.apache.poi:poi-ooxml-lite:5.2.0
have the same packages with same duplicate classes. But now I get runtime
error when create instance XWPFDocument
XWPFDocument document = new XWPFDocument(bis);
Caused by: java.lang.NoSuchFieldError: Factory
        at
org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:196)
        at org.apache.poi.ooxml.POIXMLDocument.load(POIXMLDocument.java:169)
        at
org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:159)

    This is because in classpath set
org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument.class
from org.apache.poi:ooxml-schemas:1.4. instead

org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument.class
from org.apache.poi:poi-ooxml-lite:5.2.0

    Can you please put in order
dependencies for
fr.opensagres.xdocreport:fr.opensagres.poi.xwpf.converter.pdf ?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to