0

I am trying to update our code to use XSSFWorkbook instead of HSSFWorkbook.

I have the following jars added to the project:

  • dom4j-1.6.1.jar
  • poi-3.11.jar
  • xmlbeans-2.3.0.jar
  • poi-ooxml-3.11.jar

When I try to run the part in the application that creates an excel sheet for our customer I get the following stack trace:

    java.lang.NoClassDefFoundError: org/openxmlformats/schemas/spreadsheetml/x2006/main/CTWorkbook$Factory
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.onWorkbookCreate(XSSFWorkbook.java:383)
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:218)

I have found some items here in stackoverflow which required additional jars to be downloaded and I did do that but nothing that is similar to what I am seeing now.

Thank you in advance for your help.

Joe

Joe
  • 743
  • 5
  • 10
  • 26
  • Is it possible to convert the project to a Maven project or other dependency management project? Having something manage the jar files and dependencies for you is really helpful, otherwise you run into problems like this. A couple of google searches suggested adding the poi-ooxml.jar – Orin Oct 10 '16 at 17:23
  • Orin. At this time no. – Joe Oct 10 '16 at 17:26
  • Probably the required jar files aren't in your classpath. . Check these two posts . . [post1](http://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java) and [post2](http://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java) – Shreyas Oct 10 '16 at 18:44

0 Answers0