poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <nick.bu...@alfresco.com>
Subject Re: Null Pointer Exception in WorkbookFactory.create(input-stream)
Date Tue, 12 Jan 2010 10:48:58 GMT
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: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message