title: Exception in thread "main" org.apache.poi.POIXMLException exception appearing while reading data from xlsx file using apache POI
body: <p>Please find below the code.....</p>
  
  <pre><code>package sanityTests;
  
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  
  import org.apache.poi.hssf.usermodel.HSSFSheet;
  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  import org.apache.poi.xssf.usermodel.XSSFSheet;
  import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
  
  public class ApachePOI {
  
      public static void main(String[] args) throws Exception {
  
          File src = new File("C:/Users/Ishan/Desktop/TestData.xlsx");
          FileInputStream fis = new FileInputStream(src);
          XSSFWorkbook wb = new XSSFWorkbook(fis);   // To deal with XLSX workbook 
          //HSSFWorkbook wb1 = new HSSFWorkbook(fis1);   // To deal with XLS workbook
  
          XSSFSheet sheet1 =wb.getSheetAt(0);
          String data0 = sheet1.getRow(0).getCell(0).getStringCellValue();
          System.out.println(data0);
          wb.close();
      }
  }
  </code></pre>
  
  <p>While running the program I am getting the following issue:-</p>
  
  <pre><code>Exception in thread "main" org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
      at org.apache.poi.POIXMLFactory.createDocumentPart(POIXMLFactory.java:65)
      at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:601)
      at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:174)
      at org.apache.poi.xssf.usermodel.XSSFWorkbook.&lt;init&gt;(XSSFWorkbook.java:279)
      at sanityTests.ApachePOI.main(ApachePOI.java:20)
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:56)
      at org.apache.poi.POIXMLFactory.createDocumentPart(POIXMLFactory.java:62)
      ... 4 more
  Caused by: java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setLoadEntityBytesLimit(I)Lorg/apache/xmlbeans/XmlOptions;
      at org.apache.poi.POIXMLTypeLoader.&lt;clinit&gt;(POIXMLTypeLoader.java:50)
      at org.apache.poi.xssf.model.ThemesTable.&lt;init&gt;(ThemesTable.java:85)
      ... 10 more
  </code></pre>
  
  <p>If I change the format of the file from xlsx to xls it works fine.Not sure how to resolve the error. I have included all the jars like xml-beans and poi jars. Still getting the error. Please help</p>