Closed quaso closed 1 year ago
Thank you for using this library and for taking the time to register an issue. Could you provide a sample project (preferably a test) so that we can reproduce this?
I do not have any test nor sample project ready, but it is just about using StreamingXlsxItemReader
with Excel file >10MB
Could you take some time to prepare a test project? You know what you've done to do this, when I try to setup a test it might not work due to differences in file, test etc. etc. So please take some time to make this into a test. You can share the repo or the project as a zip with this ticket.
I did a quick test with a 50Mb test file and I had no issues reading it. 14 columns of data with 500000 rows. So without a sample or test to reproduce this I'm afraid I have no clue on where to look for fixing this. I tested with both the standard Apache POI used in the build version 4.1.2 and the most recent version 5.2.2, neither of them throw an exception.
I'll try to do it :-)
Dňa st 15. 6. 2022, 16:12 Marten Deinum @.***> napísal(a):
I did a quick test with a 50Mb test file and I had no issues reading it. 14 columns of data with 500000 rows. So without a sample or test to reproduce this I'm afraid I have no clue on where to look for fixing this.
— Reply to this email directly, view it on GitHub https://github.com/spring-projects/spring-batch-extensions/issues/97#issuecomment-1156526675, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7U5BR2C4THTOVVRZIWVSLVPHQDFANCNFSM5YWWWHHQ . You are receiving this because you authored the thread.Message ID: @.***>
A start would be to add the full stacktrace to this thread instead of only the message, that might clear some things up. I did some quick googling and do you have an XLSX with large text blocks in them? That appears to be an known issue inside Apache POI?!
As a workaround (as mentioned in the error message as well), before executing your job you can do the following
org.apache.poi.util.IOUtils.setByteArrayMaxOverride(Integer.MAX_VALUE);
It will now use a larger range. The range I found for 100_000_000 is for OLE object (wrapper around some binary object). Looking at that I'm not sure if that is something we should fix in Spring Batch Excel, or that you as a user should set a better maximum. We could however make it easier to specify the maximum for a job/step and reset it afterwards, although you still would need to provide a new MAX value.
The max for this specific record type is there to prevent malicious XLSX files to be read and prevent OOM or worse.
When trying to read excel file larger than 10MB, an error occurs: