title: Apache POI exception
body: <p>I need to convert a docx to a PDF and I am going with Apache  POI. This is my POM:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi&lt;/artifactId&gt;
          &lt;version&gt;4.0.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt;
          &lt;artifactId&gt;org.apache.poi.xwpf.converter.pdf&lt;/artifactId&gt;
          &lt;version&gt;1.0.6&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;
          &lt;version&gt;4.0.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-schemas --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-ooxml-schemas&lt;/artifactId&gt;
          &lt;version&gt;4.0.0&lt;/version&gt;
      &lt;/dependency&gt;
  
  
    &lt;/dependencies&gt;
  </code></pre>
  
  <p>For some reason, I am getting an exception during when the conversion is running:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NoClassDefFoundError:
    org/apache/poi/POIXMLDocumentPart     at
    org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.getFontsDocument(XWPFStylesDocument.java:1477)
      at
    org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.(XWPFStylesDocument.java:190)
      at
    org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.(XWPFStylesDocument.java:184)
      at
    org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.createStylesDocument(XWPFDocumentVisitor.java:166)
      at
    org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.(XWPFDocumentVisitor.java:159)
      at
    org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.(PdfMapper.java:149)
      at
    org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:55)
      at
    org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:38)
      at
    org.apache.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:45)
      at temp.main.Teste(main.java:30)    at temp.main.main(main.java:18)
    Caused by: java.lang.ClassNotFoundException:
    org.apache.poi.POIXMLDocumentPart     at
    java.net.URLClassLoader.findClass(Unknown Source)     at
    java.lang.ClassLoader.loadClass(Unknown Source)   at
    sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)    at
    java.lang.ClassLoader.loadClass(Unknown Source)   ... 11 more</p>
  </blockquote>
  
  <p>I googled trying to find what is the dependency I missing, at least I think that's the case, but I can't find information about POIXMLDocumentPart that is able to fix my issue.</p>
  
  <p>This is the method i am using to convert the docx:</p>
  
  <pre><code>public static void Teste(File file, String destino) {
  
          try {
              InputStream doc = new FileInputStream(file);
              XWPFDocument document = new XWPFDocument(doc);
              PdfOptions options = PdfOptions.create();
              OutputStream out = new FileOutputStream(new File(destino));
              PdfConverter.getInstance().convert(document, out, options);
              new File(destino);
          } catch(Exception e) {
  
          }
      }
  </code></pre>