title: java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject Error
body: <p>I am getting following error  </p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject
        at OrderBook.WriteToExcelSheet.CreateOutPutFile(WriteToExcelSheet.java:20)
        at OrderBook.MainMethod.main(MainMethod.java:71)</p>
  </blockquote>
  
  <p>I looked for the reasons for this error online but couldn't find why I am getting it.</p>
  
  <p>I have included the following jar files</p>
  
  <pre><code>poi-3.9-20121203.jar, 
  poi-excelant-3.9-20121203.jar,
  poi-examples-3.9-20121203.jar,
  poi-ooxml-3.9-20121203.jar,
  poi-ooxml-schemas-3.9-20121203.jar,
  poi-scratchpad-3.9-20121203.jar
  </code></pre>
  
  <p>Code: </p>
  
  <pre><code>public class WriteToExcelSheet {
      public static Map &lt; Integer, Object[] &gt; data = new TreeMap &lt; Integer, Object[] &gt; ();
      public static void CreateOutPutFile() {
          XSSFWorkbook workbook = new XSSFWorkbook();
          XSSFSheet sheet = workbook.createSheet("Orderbook Stats");
          //This data needs to be written (Object[])
          //Iterate over data and write to sheet
          Set &lt; Integer &gt; keyset = data.keySet()
          int rownum = 0;
          for (Integer key: keyset) {
              Row row = sheet.createRow(rownum++);
              Object[] objArr = data.get(key);
              int cellnum = 0;
              for (Object obj: objArr) {
                  Cell cell = row.createCell(cellnum++);
                  if (obj instanceof String) cell.setCellValue((String) obj);
                  else if (obj instanceof Integer) cell.setCellValue((Integer) obj);
              }
          }
          try {
              //Write the workbook in file system
              System.out.println("OutPutStats.xlsx writing..............................");
              FileOutputStream out = new FileOutputStream(new File("FileLocation/o.xlxs"));
              workbook.write(out);
              out.close();
              System.out.println("OutPutStats.xlsx written successfully on disk.");
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }    
  </code></pre>