I am developing a java-web-start application that reads excel files using java POI. My problem is whenever I run my code it returns an error.
Exception in thread "Thread-13" java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/WorkbookFactory
at digicare.tracking.serial.BulkUpload.UploadProgress$1read2.run(UploadProgress.java:89)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.WorkbookFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Here's my code:
try {
InputStream inp = new FileInputStream(FilePath);
Workbook wb = WorkbookFactory.create(inp);
Sheet sheet = wb.getSheetAt(0);
int maxrows = sheet.getPhysicalNumberOfRows();
for (int r = 1; r < maxrows; r++) {
Thread.sleep(1000);
lblCurrentRow.setText(String.valueOf(r));
prbProgBar.setValue(r);
txtOutPut.append(String.format("Done!!\n"));
}
} catch (Exception e) {
e.printStackTrace();
}