Java Mailing List Archive

http://www.java2.5341.com/

Home » user.poi »

Unable to construct record instance: compressByte in continue
records must be 1 while reading unicode LE string

Dave Madole

2008-09-22

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi,

Okay, thanks for the sheetname fix to XLS2CSV! With latest build works
great!

Now I've got two sets of problems. One involves the FilePass and
WriteAccess records, but I think I can figure that out--or not. In
any case, I assume I'm on my own.

The other is a bit more intractable. The worksheet I am using has
three "Text Object" graphics in the first sheet. They are graphics with
text in them. *Something* in HSSF is extracting the text. It appears that
after the first such graphic has been parsed, and as the second is about to
be--quite likely the "TextObject" it is parsing is a very long one--I get
the message in the subject as below, then finally the exception in the
subject (I've included some toString() prints). :

STDOUT:

[... LOTS OF STUFF BEFORE WE GET HERE]

org.apache.poi.hssf.record.DrawingRecord@(protected)]
SUBRECORD: [ftCmo]
  .objectType       = 0x0006 (6 )
  .objectId         = 0x1813 (6163 )
  .option          = 0x6011 (24593 )
     .locked             = true
     .printable           = true
     .autofill           = true
     .autoline           = true
  .reserved1        = 0x1E7D3D78 (511524216 )
  .reserved2        = 0x1E8E3CD8 (512638168 )
  .reserved3        = 0x00000000 (0 )
[/ftCmo]
SUBRECORD: [ftEnd]
[/ftEnd]
[/OBJ]
org.apache.poi.hssf.record.DrawingRecord@(protected)]
  .options         = 0x0212 (530 )
     .reserved1           = false
     .HorizontalTextAlignment   = 1
     .VerticalTextAlignment   = 1
     .reserved2           = 0
     .textLocked          = true
     .reserved3           = 0
  .textOrientation    = 0x0000 (0 )
  .reserved4        = 0x0000 (0 )
  .reserved5        = 0x0000 (0 )
  .reserved6        = 0x0000 (0 )
  .textLength       = 0x03AF (943 )
  .reserved7        = 0x00000000 (0 )
  .string =         Cover Art Specifications

// This is the text extracted from the "TextObject"
[snip, snip] 12 lines of text from "TextObject" deleted here
// end of text extracted from the drawing record

  .textrun = 19
  .textrun = 20
  .textrun = 20
  .textrun = 17
  .textrun = 17
  .textrun = 19
  .textrun = 17
  .textrun = 19
  .textrun = 17
  .textrun = 19
  .textrun = 17
  .textrun = 17
  .textrun = 17
  .textrun = 17
  .textrun = 17
  .textrun = 17
  .textrun = 17
  .textrun = 17
[/TXO]
org.apache.poi.hssf.record.DrawingRecord@(protected).
DrawingRecord@(protected)

[That was the last thing printed to STDOUT]

STDERR:

org.apache.poi.hssf.record.DrawingRecord@(protected)
.DrawingRecord@(protected)"
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record
instance  
    at
org.apache.poi.hssf.record.RecordFactory.createRecord (RecordFactory.java:18)
    at
org.apache.poi.hssf.eventusermodel.HSSFRecordStream.getNextRecord(HSSFRecord
Stream.java:162)
    at
org.apache.poi.hssf.eventusermodel.HSSFRecordStream.nextRecord(HSSFRecordStr
eam.java:93)
    at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.genericProcessEvents(HSS
FEventFactory.java:141)
    at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents(HSSFEventF
actory.java:98)
    at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processWorkbookEvents(HS
SFEventFactory.java:63)
    at XLS2CSVmra.process(XLS2CSVmra.java:129)
    at XLS2CSVmra.main(XLS2CSVmra.java:332)
Caused by: java.lang.IllegalArgumentException: compressByte in continue
records must be 1 while reading unicode LE string
    at
org.apache.poi.hssf.record.RecordInputStream.readUnicodeLEString(RecordInput
Stream.java:258)
    at
org.apache.poi.hssf.record.TextObjectRecord.processRawString(TextObjectRecor
d.java:194)
    at
org.apache.poi.hssf.record.TextObjectRecord.fillFields(TextObjectRecord.java
:49)
    at org.apache.poi.hssf.record.Record.<init>(Record.java:51)
    at
org.apache.poi.hssf.record.TextObjectBaseRecord.<init>(TextObjectBaseRecord.
java:80)
    at
org.apache.poi.hssf.record.TextObjectRecord.<init>(TextObjectRecord.java:37)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
    at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:513)
    at
org.apache.poi.hssf.record.RecordFactory.createRecord (RecordFactory.java:184
)
    ... 7 more
           



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 java2.5341.com - Jax Systems, LLC, U.S.A.