title: Unable to view PDF content and download PDF - Apache POI
body: <p>We are migrating Oracle DB version from 11 to 19. While testing the application, we are unable to view the PDF content and download the PDF. We are using Java version 8, Spring-MVC 5 framework for the application development and the code is running on Tomcat version 9.</p>
  <p>We are able to view the content and download the PDF on the existing Oracle 11 but not on version 19.</p>
  <p>This issue happening only for the PDF view and not on the Doc, Xls file extensions.</p>
  <p>I also referred the below links but it did not work.</p>
  <p><a href="https://stackoverflow.com/questions/43363624/converting-docx-into-pdf-in-java">Converting docx into pdf in java</a></p>
  <p><a href="https://stackoverflow.com/questions/6201736/javausing-apache-poi-how-to-convert-ms-word-file-to-pdf">Java:using apache POI how to convert ms word file to pdf?</a></p>
  <p>Please help</p>
  <p><strong>Code</strong></p>
  <pre><code>String strAbsPath = pdfTemplate.docx; 
  String strnormalizFileAbsPath = FilenameUtils.normalize(strAbsPath); 
  InputStream input = new FileInputStream(new File(normalized(strAbsPath)); 
  IXDocReport pdfRpt = XDocReportRegistry.getRegistry().loadReport(input, TemplateEngineKind.Velocity);
  
  normalizedFileAbsPath = FilenameUtils.normalize(strAbsPath); 
  OutputStream output = new FileOutputStream(new File(strnormalizFileAbsPath)); 
  Options options = Options.getTo(ConverterTypeTo.PDF).via(ConverterTypeVia.XWPF); 
  pdfRpt.convert(context, options, output); // **Error Line**
  </code></pre>
  <p><strong>Error Details</strong></p>
  <pre><code>Systemld Unknown; Line #1; Column #17907; The entity name must immediately follow the '&amp; in the entity reference. 
  fr.opensagres.xdocreport.converter.XDocConverterException: java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.ooxml.POIXMLTypeloader
  at fr.opensagres.xdocreport.document.AbstractXocReport.convert(AbstractDocReport.java:745) 
  at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
  at org.springframework.aop.framework.ClibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747) 
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
  at org.springframework.transaction.Interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) 
  at org.springframework.transaction.interceptor.TransactionInterceptor.Invoke(TransactionInterceptor.java:98)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
  at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at java.lang.Thread.run(Thread.java:748)
  Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.ooxml.POIXMLTypeLoader
  at org.apache.pol.xwpf.usermodel.XWPFDocument.onDocumentRead(XMPFDocument.java:161)
  at org.apache.pol.ooxml.PODMLDocument.load(POIXMLDocument.java:169) 
  at org.apache.poi.pf.usermodel.XWPFDocument.&lt;init&gt;(XWPFDocument.java:126)
  at fr.opensagres.xdocreport.comverter.docx.poi.itext.XWPF2PDFVialTextConverter.convert(XWPF2PDFVialTextConverter.java:66)
  at fr.opensagres.xdocreport.document.AbstractXDocReport.convert(AbstractXDocReport.java:710)
  </code></pre>
  <p>pom.xml</p>
  <pre><code>&lt;dependency&gt;
  &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt; 
  &lt;artifactId&gt;fr.opensagres.xdocreport.converter.docx.xwpf&lt;/artifactId&gt; 
  &lt;version&gt;2.0.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt; 
  &lt;artifactId&gt;fr.opensagres.xdocreport.converter&lt;/artifactId&gt; 
  &lt;version&gt;2.0.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt; 
  &lt;artifactId&gt;fr.opensagres.xdocreport.core&lt;/artifactId&gt; 
  &lt;version&gt;1.0.4&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt; 
  &lt;artifactId&gt;fr.opensagres.xdocreport.document.docx&lt;/artifactId&gt; 
  &lt;version&gt;2.0.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt; 
  &lt;artifactId&gt;fr.opensagres.xdocreport.document&lt;/artifactId&gt;
  &lt;version&gt;2.0.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt; 
  &lt;artifactId&gt;fr.opensagres.xdocreport.itext.extension&lt;/artifactId&gt;
  &lt;version&gt;2.0.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt; 
  &lt;artifactId&gt;fr.opensagres.xdocreport.template.velocity&lt;/artifactId&gt; 
  &lt;version&gt;2.0.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt; 
  &lt;artifactId&gt;fr.opensagres.xdocreport.template&lt;/artifactId&gt;
  &lt;version&gt;2.0.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;org.apache.poi&lt;/groupId&gt; 
  &lt;artifactId&gt;ooxml-schemas&lt;/artifactId&gt; 
  &lt;version&gt;1.4&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.core&lt;/artifactId&gt; 
  &lt;version&gt;1.0.6&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;dependency&gt;
  &lt;groupId&gt;fr.opensagres.xdocreport&lt;/groupId&gt; 
  &lt;artifactId&gt;org.apache.poi.xwpf.converter.xhtml&lt;/artifactId&gt; 
  &lt;version&gt;1.0.6&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;org.apache.poi&lt;/groupId&gt; 
  &lt;version&gt;5.0.0&lt;/version&gt;
  &lt;artifactId&gt;poi&lt;/artifactId&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;org.apache.poi&lt;/groupId&gt; 
  &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt; 
  &lt;version&gt;5.0.0&lt;/version&gt;
  &lt;/dependency&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.1.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
  &lt;artifactId&gt;poi-scratchpad&lt;/artifactId&gt;
  &lt;version&gt;5.0.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>