I'm using a servlet to upload .xls
(Excel Spreadsheets) files to the server. I'm using the Apache FileUpload API for the upload portion of the business logic, to ensure weather this part is working, I have successfully attempted uploading a .txt file to the Servlet after which -- the Apache FileUpload API, from the servlet side gives me an InputStream
from which I print out all the contents of the .txt
on to the console.
The part which isn't working is, when, I attempt to use that InputStream
and forward it to a method in which, I scan the user uploaded .xls
file and print it on the console. The Exception being thrown is:
java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.WorkbookFactory
This happens despite me having added both, poi-3.5-FINAL-20090928.jar
and poi-ooxml-3.5-FINAL-20090928.jar
to the Java Project Build Path. It should be mentioned that the latter file contains the WorkbookFactory
class.
Yet, when I tried scanning a .xls file which was locally present on the hard drive, from which I derived the InputStream
and forward that to print all the cells of the .xls
, it prints out the cells on each row and columns flawlessly on the console. Any solutions?