java.lang.IllegalStateException

Expecting one Styles document part, but found 0

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web1

Stack trace

  • java.lang.IllegalStateException: Expecting one Styles document part, but found 0 at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:59) at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:37) at org.apache.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:45) at poi38.ooxmlToPDF.createPDF(ooxmlToPDF.java:53) at poi38.ooxmlToPDF.main(ooxmlToPDF.java:18) Caused by: java.lang.IllegalStateException: Expecting one Styles document part, but found 0 at org.apache.poi.xwpf.usermodel.XWPFDocument.getStyle(XWPFDocument.java:441) at org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.<init>(XWPFStylesDocument.java:192) at org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.<init>(XWPFStylesDocument.java:186) at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.createStylesDocument(XWPFDocumentVisitor.java:161) at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.<init>(XWPFDocumentVisitor.java:154) at org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.<init>(PdfMapper.java:149) at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:54) ... 4 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

We couldn't find other users who have seen this exception.