0
votes

I have a relatively dumb newb question, Im trying to open an xlsx file for reading using the apache POI 3.6.

XSSFWorkbook workBook = new XSSFWorkbook("C:\test.xlsx");

The xlsx file was saved in excel 2007, the error Im seeing is: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException

  • I dont know what the solution is... any ideas and/or example code?
2

2 Answers

2
votes

Your classpath is missing one of the dependencies for Apache POI. Specifically, you are missing the XMLBeans jar. Are you using Maven?

0
votes

and you can download it from here: http://apache.securedservers.com/xmlbeans/binaries/xmlbeans-2.5.0.zip

if (most ppbly) you're using an IDE (eclipse etc) add it in the build path...

if invoking from the CLI use the -cp switch as you might be doing for everything else...

rgds

-ksm