title: Cannot get a numeric value from a text cell
body: <p>I am trying to import the data from Excel to MySQL.</p>
  
  <pre><code>    java.util.ArrayList;
      import java.util.Iterator;
  
      import org.apache.poi.ss.usermodel.Cell;
      import org.apache.poi.ss.usermodel.DataFormatter;
      import org.apache.poi.ss.usermodel.Row;
      import org.apache.poi.ss.usermodel.Sheet;
  
      import moduleobject.Summary;
  
      public class SummaryReader implements SheetReader&lt;ArrayList&lt;Summary&gt;&gt; {
  
          public ArrayList&lt;Summary&gt; read(Sheet sheet) {
  
              Iterator&lt;Row&gt; rowiterator = sheet.iterator();
              rowiterator.next();
              ArrayList&lt;Summary&gt; list = new ArrayList&lt;&gt;();
              Summary obj = new Summary();
              while (rowiterator.hasNext()) {
  
                  Row nextRow = rowiterator.next();
                  Iterator&lt;Cell&gt; celliterator = nextRow.cellIterator();
  
                  while (celliterator.hasNext()) {
  
                      obj.setProcessor(celliterator.next().getStringCellValue());
                      obj.setProcessName(celliterator.next().getStringCellValue());
  
                      obj.setLevel(celliterator.next().getNumericCellValue());
                      obj.setPA11(celliterator.next().getNumericCellValue());
                      obj.setPA21(celliterator.next().getNumericCellValue());
                      obj.setPA22(celliterator.next().getNumericCellValue());
  
                      // obj.setPA31(celliterator.next().getNumericCellValue());
                      // obj.setPA32(celliterator.next().getNumericCellValue());
                  }
              }
  
              list.add(obj);
  
              return list;
          }
  
      }
  </code></pre>
  
  <p>The error I am getting is</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalStateException: Cannot get a numeric value from a text cell
      at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSSFCell.java:994)
      at org.apache.poi.xssf.usermodel.XSSFCell.getNumericCellValue(XSSFCell.java:305)
      at reader.SummaryReader.read(SummaryReader.java:32)
      at reader.SummaryReader.read(SummaryReader.java:1)
      at controller.JobController.startJob(JobController.java:69) at job.JobLauncher.main(JobLauncher.java:21)
  </code></pre>
  
  <p>Why do I get this exception?</p>