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 2008/04/08 07:28:42 UTC

DO NOT REPLY [Bug 44774] New: org.apache.poi.hssf.record. RecordFormatException: Unable to construct record instance

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

           Summary: org.apache.poi.hssf.record.RecordFormatException: Unable
                    to construct record instance
           Product: POI
           Version: 3.0-dev
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: mrlal_tvm@yahoo.com


Created an attachment (id=21790)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21790)
Excel FIle

This file doest open in release 'poi-3.0.3-alpha1-20080404.jar" but it works
opens with "poi-3.0.2-FINAL-20080204.jar"

Following is the error thrown.

org.apache.poi.hssf.record.RecordFormatException: Unable to construct record
instance
        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:206)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:124)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:204)
        at TestUserHome.main(TestUserHome.java:41)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:194)
        ... 3 more
Caused by: java.lang.ArrayIndexOutOfBoundsException
        at
org.apache.poi.hssf.record.RecordInputStream.checkRecordPosition(RecordInputStream.java:132)
        at
org.apache.poi.hssf.record.RecordInputStream.readShort(RecordInputStream.java:152)
        at
org.apache.poi.hssf.record.ExternalNameRecord.fillFields(ExternalNameRecord.java:156)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
        at
org.apache.poi.hssf.record.ExternalNameRecord.<init>(ExternalNameRecord.java:51)
        ... 8 more


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 44774] RecordFormatException & IOException: Unable to construct record instance

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





--- Comment #3 from Josh Micich <jo...@gildedtree.com>  2008-04-10 00:20:28 PST ---
(In reply to comment #0)
> Created an attachment (id=21790)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21790) [details]
> Excel FIle
> 
> This file doest open in release 'poi-3.0.3-alpha1-20080404.jar" but it works
> opens with "poi-3.0.2-FINAL-20080204.jar"
> 
> ... Caused by: java.lang.ArrayIndexOutOfBoundsException ...
> ... ExternalNameRecord.fillFields ....

I created a separate bugzilla (bug 44792) for this bug.  More problems were
found (after the first one in ExternalNameRecord) when re-writing this XLS
file.  Excel could not open the output file properly due to problems in
CRNRecord.  These were also fixed in bug 44792.

POI now seems to be able to read attachment (id=21790) and write it back
without any obvious corruption.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 44774] RecordFormatException & IOException: Unable to construct record instance

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #5 from Nick Burch <ni...@torchbox.com>  2008-07-10 15:50:10 PST ---
I believe this bug is fixed in 3.1 FINAL. Please re-open the bug, and attach a
new stack trace if you're still having problems with 3.1 FINAL


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 44774] org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance

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





--- Comment #2 from Lal M.R <mr...@yahoo.com>  2008-04-07 22:42:21 PST ---
Created an attachment (id=21792)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21792)
This file also gives gives IO Exception.

Cannot remove block[ 215 ]; out of range
java.io.IOException: Cannot remove block[ 215 ]; out of range
        at
org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:104)
        at
org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks(BlockAllocationTableReader.java:190)
        at
org.apache.poi.poifs.storage.BlockListImpl.fetchBlocks(BlockListImpl.java:129)
        at
org.apache.poi.poifs.filesystem.POIFSFileSystem.processProperties(POIFSFileSystem.java:536)
        at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:175)
        at TestUserHome.main(TestUserHome.java:40)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 44774] org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance

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





--- Comment #1 from Lal M.R <mr...@yahoo.com>  2008-04-07 22:37:56 PST ---
Created an attachment (id=21791)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21791)
This file gives gives IO Exception.

Cannot remove block[ 215 ]; out of range
java.io.IOException: Cannot remove block[ 215 ]; out of range
        at
org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:104)
        at
org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks(BlockAllocationTableReader.java:190)
        at
org.apache.poi.poifs.storage.BlockListImpl.fetchBlocks(BlockListImpl.java:129)
        at
org.apache.poi.poifs.filesystem.POIFSFileSystem.processProperties(POIFSFileSystem.java:536)
        at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:175)
        at TestUserHome.main(TestUserHome.java:40)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 44774] RecordFormatException & IOException: Unable to construct record instance

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





--- Comment #4 from Josh Micich <jo...@gildedtree.com>  2008-04-10 00:52:39 PST ---
(In reply to comment #1)
> Created an attachment (id=21791)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21791) [details]
> ... java.io.IOException: Cannot remove block[ 215 ]; out of range
> ...

I get "Cannot remove block[ 454 ]; out of range".  (I assume you accidentally
copied the stack trace from the attachment 21792.

(In reply to comment #2)
> Created an attachment (id=21792)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21792) [details]
> ... java.io.IOException: Cannot remove block[ 215 ]; out of range
> ...

I get this error exactly. The following test code hits the same error, without
HSSFWorkbook:

try {
  InputStream is = new FileInputStream("ex44774-21792.xls");
  new POIFSFileSystem(is);
} catch (IOException e) {
  if (e.getMessage().equals("Cannot remove block[ 215 ]; out of range")) {
    throw new AssertionFailedError("Identified bug 44774");
  }
  throw new RuntimeException(e);
}

I tried this code out against poi-3.0.2-FINAL-20080204.jar and got a different
error:

java.lang.RuntimeException: java.io.IOException: Unable to read entire block;
479 bytes read before EOF; expected 512 bytes
        at example.poi.Test44774.test44774(Test44774.java:43)
Caused by: java.io.IOException: Unable to read entire block; 479 bytes read
before EOF; expected 512 bytes
        at
org.apache.poi.poifs.storage.RawDataBlock.<init>(RawDataBlock.java:78)
        at
org.apache.poi.poifs.storage.RawDataBlock.<init>(RawDataBlock.java:50)
        at
org.apache.poi.poifs.storage.RawDataBlockList.<init>(RawDataBlockList.java:52)
        at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:93)
        at example.poi.Test44774.test44774b(Test44774.java:38)
        ... 18 more

There seems to have been some work done in this area recently.
(see bugzilla bug 28231 and bug 35928 / svn r634318 and r636786)

Hopefully someone with more knowledge of POIFS can help diagnose this further.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 44774] RecordFormatException & IOException: Unable to construct record instance

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


Lal M.R <mr...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|org.apache.poi.hssf.record.R|RecordFormatException &
                   |ecordFormatException: Unable|IOException: Unable to
                   |to construct record instance|construct record instance




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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