I am trying to use POI in a servlet to process an uploaded file as Excel file:
public static String readExcel(InputStream inp) {
// InputStream inp = null;
As detailed in the Apache POI page on Components and their Dependencies...
If you want to use Common SS code, such as WorkbookFactory, you need both the poi
and poi-ooxml
POI jars on your classpath. In addition, you also need their dependencies too. One of the listed dependencies is xmlbeans
, which incidentally is where your missing class comes from
So, you just need to review the Components and Dependencies page, then make sure you include the appropriate jars from the binary package of Apache POI on your classpath. (Or use Maven and let it worry about that for you)
System couldn't find the XML beans dependency on your classpath so you should add the XML beans dependency to your class path.
The XML beans library looks like xmlbeans-x.x.x.jar
https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans
As found here, you have to add (at least that was it in my case): xmlbeans-2.6.0.jar