You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/06/28 20:09:00 UTC

[Bug 53482] New: NPE in ODocumentInputStream.readUShort() when parsing XLS

https://issues.apache.org/bugzilla/show_bug.cgi?id=53482

          Priority: P2
            Bug ID: 53482
          Assignee: dev@poi.apache.org
           Summary: NPE in ODocumentInputStream.readUShort() when parsing
                    XLS
          Severity: major
    Classification: Unclassified
          Reporter: tjuchniewicz@gmail.com
          Hardware: PC
            Status: NEW
           Version: 3.9-dev
         Component: HSSF
           Product: POI

Created attachment 29005
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29005&action=edit
Example XLS file.

Stacktrace:

Caused by: java.lang.NullPointerException
    at
org.apache.poi.poifs.filesystem.ODocumentInputStream.readUShort(ODocumentInputStream.java:294)
    at
org.apache.poi.poifs.filesystem.DocumentInputStream.readUShort(DocumentInputStream.java:163)
    at
org.apache.poi.hssf.record.RecordInputStream$SimpleHeaderInput.readRecordSID(RecordInputStream.java:98)
    at
org.apache.poi.hssf.record.RecordInputStream.readNextSid(RecordInputStream.java:177)
    at
org.apache.poi.hssf.record.RecordInputStream.<init>(RecordInputStream.java:115)
    at
org.apache.poi.hssf.record.RecordInputStream.<init>(RecordInputStream.java:103)
    at
org.apache.poi.hssf.record.RecordFactoryInputStream.<init>(RecordFactoryInputStream.java:180)
    at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:440)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:285)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:248)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:192)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:327)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:308)
    at
org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:70)

When file form attachment is re-saved in MS Office or OpenOffice then POI parse
XLS with no NPE.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53482] NPE in ODocumentInputStream.readUShort() when parsing XLS

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53482

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #3 from Nick Burch <ni...@alfresco.com> ---
There are a couple of design snags in the older POIFS implementation, which is
partly why we re-wrote it (those and cleaner code now the documentation is
better + public, lower memory footprint etc). I think this bug is likely
related to one of the gnarly bits in the old codebase, so I'm marking this as
Won't Fix since it's corrected by the new implementation

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53482] NPE in ODocumentInputStream.readUShort() when parsing XLS

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53482

--- Comment #2 from tjuchniewicz <tj...@gmail.com> ---
Yes. After switching to NPOIFSFileSystem it works fine. My problem is solved,
thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53482] NPE in ODocumentInputStream.readUShort() when parsing XLS

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53482

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 OS|                            |All

--- Comment #1 from Nick Burch <ni...@alfresco.com> ---
Does opening the file with NPOIFSFileSystem rather than the older
POIFSFileSystem solve the problem for you?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org