You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Davis, Zach" <Za...@polk.com> on 2009/01/21 15:45:24 UTC

Workbook problems with POI. Exceptions thrown during load

We have roughly 100,000 workbooks in HSSF format, we are currently
seeing a large number of files error out from POI during the initial
loading of the workbook. Many of these files work just fine in Excel and
we've already ignored files that wouldn't open in Excel when we came
across them. I was wondering if any of these errors could be a POI
problem and not exactly the workbook.

If any of these can be easily fixed or worked around please let me
know.... Already tried saving in Excel but its complicated by the fact
that we cant save every workbook using that method as we have over 8,000
not currently loading. Here is a list of things we've found. Due to
these workbooks containing private information I am unable to send them
out. Worst case I might be able to clear out a workbook, get approval,
and send one if I'm lucky. I would assume for now that I cant send them
out. Thanks for any help.

	Unable to open file!
		Cannot remove block[ 30408811 ]; out of range[ 0 - 1505
]

	Unable to open file!
		Cannot remove block[ 1274923274 ]; out of range[ 0 -
3545 ]

	Unable to open file!
		Cannot remove block[ 1274923274 ]; out of range[ 0 -
4770 ]

	Unable to open file!
		Cannot remove block[ -1450656249 ]; out of range[ 0 -
2694 ]

	Unable to open file!
		Unable to read entire header; 0 bytes read; expected 512
bytes

	(roughly 80% of my 8,000 problem files have this exact error....
most important issue to address for us)
	Unable to process excel record that is larger than 8224 bytes
		Unable to construct record instance

	Unable to process excel record that is larger than 8224 bytes
		The content of an excel record cannot exceed 8224 bytes


Cheers,
Zach Davis
Associate IT Programmer Analyst
R.L. Polk Southfield Office

*****************************************************************
This message has originated from R. L. Polk & Co.,
26955 Northwestern Highway, Southfield, MI 48033.
R. L. Polk & Co. sends various types of email
communications.  If this email message concerns the
potential licensing of a Polk product or service, and
you do not wish to receive further emails regarding Polk
products, forward this email to Do_Not_Send@polk.com
with the word "remove" in the subject line.

The email and any files transmitted with it are confidential
and intended solely for the individual or entity to whom they
are addressed.

If you have received this email in error, please delete this
message and notify the Polk System Administrator at
postmaster@polk.com.
*****************************************************************

RE: Workbook problems with POI. Exceptions thrown during load

Posted by "Davis, Zach" <Za...@polk.com>.
Just on my way out but I'll follow up tomorrow. Very helpful reply,
thank you sir.

Cheers,
Zach Davis
Associate IT Programmer Analyst
R.L. Polk Southfield Office


-----Original Message-----
From: Josh Micich [mailto:josh.micich@gmail.com] 
Sent: Wednesday, January 21, 2009 4:56 PM
To: POI Users List
Subject: Re: Workbook problems with POI. Exceptions thrown during load

Hello Zach,

The "Cannot remove block" errors you are getting look a lot like this
previously fixed bug:
https://issues.apache.org/bugzilla/show_bug.cgi?id=44898

However, I notice that the error message you are getting is from after
this
change:
http://svn.apache.org/viewvc?view=rev&revision=653945
And the full fix was very soon after that:
http://svn.apache.org/viewvc?view=rev&revision=658285

POI version 3.1-beta2 came out between these two revisions, so if you
have
that version, the fix might be a simple matter of upgrading.

I searched for the message "Unable to process excel record that is
larger
than 8224 bytes" in the POI source (and also in 3.0 and 3.1), but I
could
not find it.  I can find the other messages "Unable to construct record
instance" - RecordFactory.java:236 and "The content of an excel record
cannot exceed 8224 bytes" - RecordInputStream.java:169, but there is
really
not enough information to work on here.  There have been changes in this
area of POI, and the fact that your error message is not present in the
source suggests that those changes might be related to the bug you are
seeing.

I'm guessing that the pairs of messages with the second line indented
are
due to nesting of exceptions.  It would be more helpful if the stack
trace
frames were included (from the first POI frame onward - your code's
frames
can be omitted).

Try a recent POI 3.5beta build
(http://encore.torchbox.com/poi-svn-build/).
If the problems are still present, we'll probably need much more than
just
stack traces to diagnose them.  For "larger than 8224 bytes" problem, it
may
be enough to supply a hex dump of the offending record (and one or two
prior
records).  For the "Cannot remove block" problem, the whole file may be
required, but removing private data will probably make the error go away
(because Excel often automatically fixes abnormal file structures).  You
may
be stuck with doing all the debugging yourself.


regards,
Josh
*****************************************************************
This message has originated from R. L. Polk & Co.,
26955 Northwestern Highway, Southfield, MI 48033.
R. L. Polk & Co. sends various types of email
communications.  If this email message concerns the
potential licensing of a Polk product or service, and
you do not wish to receive further emails regarding Polk
products, forward this email to Do_Not_Send@polk.com
with the word "remove" in the subject line.

The email and any files transmitted with it are confidential
and intended solely for the individual or entity to whom they
are addressed.

If you have received this email in error, please delete this
message and notify the Polk System Administrator at
postmaster@polk.com.
*****************************************************************

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


Re: Workbook problems with POI. Exceptions thrown during load

Posted by Josh Micich <jo...@gmail.com>.
Hello Zach,

The "Cannot remove block" errors you are getting look a lot like this
previously fixed bug:
https://issues.apache.org/bugzilla/show_bug.cgi?id=44898

However, I notice that the error message you are getting is from after this
change:
http://svn.apache.org/viewvc?view=rev&revision=653945
And the full fix was very soon after that:
http://svn.apache.org/viewvc?view=rev&revision=658285

POI version 3.1-beta2 came out between these two revisions, so if you have
that version, the fix might be a simple matter of upgrading.

I searched for the message "Unable to process excel record that is larger
than 8224 bytes" in the POI source (and also in 3.0 and 3.1), but I could
not find it.  I can find the other messages "Unable to construct record
instance" - RecordFactory.java:236 and "The content of an excel record
cannot exceed 8224 bytes" - RecordInputStream.java:169, but there is really
not enough information to work on here.  There have been changes in this
area of POI, and the fact that your error message is not present in the
source suggests that those changes might be related to the bug you are
seeing.

I'm guessing that the pairs of messages with the second line indented are
due to nesting of exceptions.  It would be more helpful if the stack trace
frames were included (from the first POI frame onward - your code's frames
can be omitted).

Try a recent POI 3.5beta build (http://encore.torchbox.com/poi-svn-build/).
If the problems are still present, we'll probably need much more than just
stack traces to diagnose them.  For "larger than 8224 bytes" problem, it may
be enough to supply a hex dump of the offending record (and one or two prior
records).  For the "Cannot remove block" problem, the whole file may be
required, but removing private data will probably make the error go away
(because Excel often automatically fixes abnormal file structures).  You may
be stuck with doing all the debugging yourself.


regards,
Josh