On Mon, 11 Jan 2010, Scott Callaghan wrote:
I get a null pointer exception when I use a WorkbookFactory.create()

java.lang.NullPointerException
   at org.apache.poi.util.PackageHelper.copy(PackageHelper.java:129)
   at org.apache.poi.util.PackageHelper.clone(PackageHelper.java:87)
   at org.apache.poi.util.PackageHelper.clone(PackageHelper.java:44)
   at org.apache.poi.POIXMLDocument.ensureWriteAccess(POIXMLDocument.java:185)
   at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:169)
   at 
org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:63)

This looks to me like there's something corrupt in the relationship definitions in your file. Can you upload the file so we can take a look?

(When you pass in an input stream, we have to do an in-memory buffer/copy to work on it. You'll save memory by passing the file directly to opcpackage, but that requires you to know it's xssf ahead of time)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to