Gunjan Shah
Gunjan Shah

Reputation: 5168

Apache POI 3.9 : WorkbookFactory method not found

In my app I have used Apache POI 3.8 for XLS file processing.

Now I want to migrate to Apache POI 3.9 latest and stable version. I have added the JAR file poi-3.9-20121203.jar in my application and removed JARs related to POI 3.8.

But it seems that, in 3.9 version, the WorkbookFactory class has been removed.

So how can I create a Workbook with WorkbookFactory in Apache POI 3.9 ?

I extracted the JAR and checked, there is no class like WorkbookFactory.

Can anyone tell me how to create a new workbook with POI 3.9?

Upvotes: 22

Views: 33010

Answers (2)

Gagravarr
Gagravarr

Reputation: 48336

You're missing several JARs. Take a look at the POI Components Page and you'll see that you need the POI-3.9 jar, the POI-OOXML-3.9 jar, and their respective dependencies.

If you want to work with any of the other formats (eg doc, docx, ppt, pptx) you'll also need the POI-Scratchpad-3.9 jar. As you're working with the OOXML file formats (eg .xlsx), as shown in the components page, you'll need either the POI-OOXML_Schemas-3.9 jar, or the larger full OOXML-Schemas-1.1 jar.

Also, since this question was asked, there have been two new releases of Apache POI, with lots of bugs fixed and new features added, so it's worth using the latest version (3.11 as of writing) rather than 3.9!

Upvotes: 43

PhiLho
PhiLho

Reputation: 41142

I would be surprised that they made such breaking change without mentioning it in the list of changes...

And indeed, I can see the WorkbookFactory in the JavaDoc, which I suppose are up-to-date with the latest version.

Perhaps you can show some simple code that worked in 3.8 and no longer works in 3.9, along with the error message(s) you get. The problem might not be what you think...

Upvotes: 1

Related Questions